# 日本語のWaySpotnameの対応方法（Lightship VPS Scavenger Hunt）

**URL:** <https://forum.8thwall.com/t/wayspotname-lightship-vps-scavenger-hunt/4494>\
**Category:** 日本語カテゴリ\
**Tags:** vps\
**Created:** [January 16, 2025, 4:20am UTC](https://forum.8thwall.com/t/wayspotname-lightship-vps-scavenger-hunt/4494 "2025-01-16T04:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satoru\_ODO](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@Satoru\_ODO](https://forum.8thwall.com/u/Satoru_ODO)\
**Post date:** [January 16, 2025, 4:20am UTC](https://forum.8thwall.com/t/wayspotname-lightship-vps-scavenger-hunt/4494/1 "2025-01-16T04:20:38Z")

</div>

「Lightship VPS Scavenger Hunt」の「named-wayspot=“name: YOURWAYSPOTNAME”」のYOURWAYSPOTNAMEに日本語のWaySpot名を指定することができません．また，scenes以下にWaySpot名に合わせた日本語名のHTMLファイルも配置できません．

対応としてapp.js内に  
const nameMapping = {  
‘日本語のWaySpot名１’: ‘nihogo1’,  
‘日本語のWaySpot名２’: ‘nihogo2’,  
‘日本語のWaySpot名３’: ‘nihogo3’,  
‘日本語のWaySpot名４’: ‘nihogo4’,  
}  
の追加と  
window.addEventListener(‘startar’, ({detail}) =\> {  
const mappedName = nameMapping[detail.name] || detail.name  
swapBody(require(`./scenes/${mappedName}.html`))  
window.\_startAR = detail  
})  
として日本語を英数文字に変換し，scenes以下のHTMLファイルも同様に変更しました．  
vpsspot-meshes以下のファイル名も変更済みです．

しかし，実行すると以下のエラーが出てしまいます．  
Unhandled promise rejection: TypeError: undefined is not an object (evaluating ‘t.constructor’)  
Unhandled promise rejection: TypeError: undefined is not an object (evaluating ‘this.schema[n].schemaChange’)

その他，変更しなければならない個所や対応方法をご存じの方が居ましたらご助言頂けないでしょうか．  
よろしくお願いします．

---

<div class="post-metadata">

**Author:** ![GeorgeButler](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.8thwall.com/georgebutler/32/1903_2.png) [@GeorgeButler](https://forum.8thwall.com/u/GeorgeButler)\
**Post date:** [January 16, 2025, 5:46pm UTC](https://forum.8thwall.com/t/wayspotname-lightship-vps-scavenger-hunt/4494/2 "2025-01-16T17:46:12Z")

</div>

Hi, welcome to the forums!

Because filenames can’t have japanese characters but you can have Japanese characters in your code the workaround here is fairly simple. You’ll want to create a variable that will be a map between the Japanese location name and the HTML file you want to go to.

For example:

```ts
const locationsToScene = new Map();
map1.set('日本語のWaySpot名1', 'wayspot1.html');
map1.set('日本語のWaySpot名2', 'wayspot2.html');
map1.set('日本語のWaySpot名3', 'wayspot3.html');

```

Then when you want to switch to that scene you can get the file name by getting the value associated with the key:

```ts
window.addEventListener('startar', ({ detail }) => {
  const mappedName = locationsToScene.get(detail.name);
  
  if (mappedName) {
    swapBody(require(`./scenes/${mappedName}`));
    window._startAR = detail;
  } else {
    console.error(`No scene associated with ${detail.name}`);
  }
});

```
