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

import(require) 路径中不能有 . 符号 #226

Closed
blooddrunk opened this issue Jun 28, 2018 · 1 comment
Closed

import(require) 路径中不能有 . 符号 #226

blooddrunk opened this issue Jun 28, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@blooddrunk
Copy link

blooddrunk commented Jun 28, 2018

if (process.env.NODE_ENV === 'production') {
  module.exports = require('./configureStore.prod');
} else {
  module.exports = require('./configureStore.dev');
}

以上代码会报错

VM11222:1 thirdScriptError 
 sdk uncaught third Error 
 module "store/configureStore.dev.js" is not defined 
 Error: module "store/configureStore.dev.js" is not defined
    at require (http://127.0.0.1:18114/appservice/__dev__/WAService.js:19:7163)
    at http://127.0.0.1:18114/appservice/__dev__/WAService.js:19:7018
    at http://127.0.0.1:18114/appservice/store/configureStore.js:6:20
    at require (http://127.0.0.1:18114/appservice/__dev__/WAService.js:19:7304)
    at http://127.0.0.1:18114/appservice/__dev__/WAService.js:19:7018
    at http://127.0.0.1:18114/appservice/app.js:17:23
    at require (http://127.0.0.1:18114/appservice/__dev__/WAService.js:19:7304)
    at http://127.0.0.1:18114/appservice/appservice?t=1530192839550:1196:9

更改文件名和代码去掉 . 后(比如configureStoreDev)正常

@luckyadam luckyadam added the bug Something isn't working label Jun 28, 2018
@luckyadam
Copy link
Member

最新的 beta 版本解决了这个问题 b68b983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants