0dataapp/hello

Examples not loading because of 'linker' files

michaud opened this issue · 3 comments

I tried to run the examples (Solid), the page loads but errors on trying to load(?) '../../common/main.js' from main.js
main.js:1 Uncaught SyntaxError: Unexpected token '.'
env:
windows 10
vite v2.7.13

Hey thanks for opening an issue!

The issue probably happens because the files are linked, not duplicated. It works on linux, but I suppose it doesn't work in windows :(. Maybe we'll have to duplicate the files.

In the meantime, you can fix the issue in your machine by replacing the symlinks by duplicated files (which is the one in the common folder). The vite.config.js file is also linked, but it's only needed to support symlinks so maybe you don't need that.

Yes, I copied the main.js files into the examples and got it working! I found a different way to get it working:
if you make the script in the index.html a module:

<script type="module" src="./main.js"></script>

and import the common/main.js in the local main.js:

import "../../common/main"

then the example works on windows and it should work on other platforms as well!

if you make the script in the index.html a module:

<script type="module" src="./main.js"></script>

and import the common/main.js in the local main.js:

import "../../common/main"

then the example works on windows and it should work on other platforms as well!

That's nice, thanks for sharing, I may give it a try.