hello icon indicating copy to clipboard operation
hello copied to clipboard

Examples not loading because of 'linker' files

Open michaud opened this issue 3 years ago • 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

michaud avatar Feb 02 '22 14:02 michaud

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.

NoelDeMartin avatar Feb 02 '22 19:02 NoelDeMartin

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!

michaud avatar Feb 03 '22 00:02 michaud

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

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.

NoelDeMartin avatar Feb 03 '22 06:02 NoelDeMartin