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

Module build failed: TypeError: Cannot read property 'spec' of undefined #6988

Closed
changfuguo opened this Issue Dec 7, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@changfuguo

changfuguo commented Dec 7, 2017

Choose one: is this a bug report or feature request?

bug report

ERROR in ./src/modules/todos/index.js
Module build failed: TypeError: Cannot read property 'spec' of undefined (While processing preset: "/Users/didi/Code/orion_m/risk_manage/node_modules/@babel/preset-env/lib/index.js")
    at _default (/Users/didi/Code/orion_m/risk_manage/node_modules/@babel/plugin-transform-arrow-functions/lib/index.js:7:21)
    at Function.memoisePluginContainer (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:113:13)
    at Function.normalisePlugin (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:146:32)
    at /Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:184:30
    at Array.map (native)
    at Function.normalisePlugins (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at /Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:265:14
    at /Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:323:22
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/didi/Code/orion_m/risk_manage/node_modules/babel-core/lib/transformation/file/index.js:135:24)
 @ multi ./src/modules/todos/index.js webpack-hot-middleware/client?path=/__webpack_hmr&timeout=20000&reload=true

Input Code

my babelrc config is below:

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
  	"presets": [
	    ["@babel/preset-env", {
	      	"targets": {
	        	"browsers": ["last 2 versions", "safari >= 7"]
	      	},
	      	"modules": false,
     		"loose": true
	    }]
  	]
}

Expected Behavior

Current Behavior

Possible Solution

Context

Your Environment

software version(s)
Babel 6.26.0
Babylon
node 6.4
npm 3.10.3
Operating System macOs
@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Dec 7, 2017

Collaborator

Hey @changfuguo! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Collaborator

babel-bot commented Dec 7, 2017

Hey @changfuguo! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@changfuguo changfuguo changed the title from Module build failed: TypeError: Cannot read property 'spec' of undefined (While processing preset: "/Users/didi/Code/orion_m/risk_manage/node_modules/@babel/preset-env/lib/index.js") to Module build failed: TypeError: Cannot read property 'spec' of undefined Dec 7, 2017

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Dec 7, 2017

Member

Hi, the problem is that you are using @babel/preset-env (which is version 7) with Babel 6. The two versions are not compatible. I'd suggest using babel-preset-env (which is version 6) instead.

Member

nicolo-ribaudo commented Dec 7, 2017

Hi, the problem is that you are using @babel/preset-env (which is version 7) with Babel 6. The two versions are not compatible. I'd suggest using babel-preset-env (which is version 6) instead.

@lock lock bot added the outdated label May 3, 2018

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.