-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
TS support fails with incorrect browser import #61
Comments
give full file name |
No, this does not work because a |
This works
|
It works for me. Are you on windows? A reproduction with your system information would help when reporting issues. |
Ah yeah, sorry! Here are the system/project informations: macOS Catalina 10.15.4 (19E287)
node v13.7.0
yarn 1.22.0
Project deps:
"vue": "^3.0.0-beta.9"
"vite": "^0.11.1"
"@vue/compiler-sfc": "^3.0.0-beta.9" I took a closer look at this. The problem occurs to me when App.vue is located in a folder (e.g. |
@akaufmann if I understand your problem correctly, this should be the correct behaviour, you are trying to import a file that doesn't exist. In Node, it would throw an error as well (
I see that if I change the file's extension from What would happen if I'd use something that doesn't need a transpiler or a bundler, like Preact + HTM, as I've seen from @yyx990803's tweets that's possible, and I use Vite just as a development server? Well... the code that works on the development server wouldn't work in my production environment (if you can call it that) because the extensions are missing from the |
For example, when you import a TS file into App.vue and access an exported member...
... you get an
Failed to load module script
error:vite
/esbuild
creates afoo
resource without the.js/.ts
extension. The JS file is also not accessible if you call it directly likehttp://localhost:3000/<path/to/foo.js>?t=<hash>
.The text was updated successfully, but these errors were encountered: