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
Wrong generated JS code by TypeScript and AMD ( UMD) - version 2 #7383
Comments
I'm sorry, but this is really an out of scope question for a very specific setup that should not be resolved in issues. Issues are for bug reports that originates from Vue itself only. |
@80LevelElf -- I solved this (for now) by doing the following:
@yyx990803 -- I'm in a similar, but different situation. I'm using I too am using Vue 2.5.13. I'm setting up SSR on Node 8.9.3 and TypeScript 2.6. My
I tried a number of other workaround, including trying to load the vue.esm.js file via the I've put together a reproduction here and opened a new issue |
I ran into the same issue. From my understanding, the vue.js file should be setting the vue-class-component.js (Line 192): The vue-class-component file has a special case to handle the missing default export from Vue, which is why it works. vue-class-component.js (Line 12): Unfortunately, the TypeScript 2.5 compiler does not output a special case for handling the missing default. However, TypeScript 2.7 has a new option (
With
|
Version
2.5.13
Reproduction link
https://github.com/80LevelElf/VueProblemApp
Steps to reproduce
Just run the app by opening the
/VueProblemApp/VueProblemApp/index.html file and you will see the error in the Console.
What is expected?
The Typescript compiler should take Vue typings and produce the right code.
What is actually happening?
The resulted JS code is not right (see comments for detail explonation).
Several days ago I created the Wrong generated JS code by TypeScript and AMD ( UMD) bug (click the link to see detail explanation of the problem).
I got an answer from @yyx990803, but I am a noob in the JS and didn't get it right from the first time.
And if I get it right now, the problem is still relevant.
Evan answered me:
So if I get Evan right he thought that RequireJS download the wrong vue.js file.
The right one is for UMD/AMD module system, but the TS compiler makes a reference to the vue.js file for CommonJS module system. This is why I had got the error.
But it's not right. TS compiler just make a reference to
and in my case it is:
no matter what vue.js file is. So if there is no vue.js in this link there will be the 404 error.
Also, I try to change the main config in node_modules/vue/package.json like that: "main": "dist/vue.js" and it gives me the same error.
I have checked the vue.js file that is loading by RequireJS and it is the right file. RequireJS parse it right, the problem is in the typings.
Also if I make the import like this (like @Micene09 offered):
Everything works fine with loading the same vue.js file in mySite/vue.js.
So if I get you right the problem still remains.
The text was updated successfully, but these errors were encountered: