Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples not loading because of 'linker' files #21

Open
michaud opened this issue Feb 2, 2022 · 3 comments
Open

Examples not loading because of 'linker' files #21

michaud opened this issue Feb 2, 2022 · 3 comments

Comments

@michaud
Copy link

michaud commented Feb 2, 2022

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

@NoelDeMartin
Copy link
Member

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.

@michaud
Copy link
Author

michaud commented Feb 3, 2022

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!

@NoelDeMartin
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants