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

[tally] throw warning: "export 'default' (imported as 'iView') was not found in 'iview' when npm building, cause fatal error actually #20

Closed
0xffff00 opened this issue Jan 19, 2018 · 2 comments

Comments

@0xffff00
Copy link
Owner

0xffff00 commented Jan 19, 2018

a weird bug which can be reproduced on archlinux but never on windows 10 (both OS use npm 5.5.1, node 9.3.0 and exact same generated node_modules)
when 'npm run dev' , on archlinux will throw warning messages like
"export 'default' (imported as 'iView') was not found in 'iview'
After all, it will built with warning while fully successful building on windows.
This slight difference actually causes a fatal error --- homepage can't display at all with console error after 'webpack -p'.
The error message from chrome console is
Uncaught TypeError: Cannot read property 'prototype' of undefined and located around default.prototype.$isServer

@0xffff00 0xffff00 changed the title [tally] warning: "export 'default' (imported as 'iView') was not found in 'iview' when npm build, cause fatal error actually [tally] throw warning: "export 'default' (imported as 'iView') was not found in 'iview' when npm build, cause fatal error actually Jan 19, 2018
@0xffff00 0xffff00 changed the title [tally] throw warning: "export 'default' (imported as 'iView') was not found in 'iview' when npm build, cause fatal error actually [tally] throw warning: "export 'default' (imported as 'iView') was not found in 'iview' when npm building, cause fatal error actually Jan 19, 2018
@0xffff00
Copy link
Owner Author

0xffff00 commented Jan 19, 2018

It seems to be es6 default import problem.
after many trials. I found a way to solve this problem :
import iView from 'ivew' should be replaced to const iView = require('iview') ,then warnings will be gone.

But I don't know why.

@0xffff00
Copy link
Owner Author

0xffff00 commented Jan 20, 2018

3rd trial

I found a warning message that only printed on linux but not on win10 when executing 'webpack/webpack-dev-server':
[BABEL] Note: The code generator has deoptimised the styling of "..." as it exceeds the max of "500KB".
According to (babel/babel#6041 (comment))
The reason may be to forget to exclude node_modules from 'babel-loader' in webpack modules.rules config.

{
    test: /iview\/.*?js$/,
    loader: 'babel-loader',
    exclude: /node_modules/  <---this line is missing!!!
 }

However, it's weird that this bug is never reproduced in windows version npm.Still dont know why.

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

1 participant