babel-plugin-dynamic-import-node: Error Unknown plugin "dynamic-import-node" specified in "base" at 1,

node_modules/babel-core/lib/transformation/file/options/option-manager.js:180
          throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
          ^

ReferenceError: Unknown plugin "dynamic-import-node" specified in "base" at 1, attempted to resolve relative to "/Users/z/project/src/containers"
    at /Users/z/project/src/_server/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (<anonymous>)
    at Function.normalisePlugins (/Users/z/project/src/_server/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/Users/z/project/src/_server/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/Users/z/project/src/_server/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/Users/z/project/src/_server/node_modules/babel-register/lib/node.js:103:45)
    at loader (/Users/z/project/src/_server/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/z/project/src/_server/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

require('babel-register')({ plugins: ["transform-decorators-legacy", "dynamic-import-node"], presets: ['es2015', 'stage-0', 'react'], // ignore: /scss/, extensions: [".es6", ".es", ".jsx", ".js"] }); trying to use this plugin cause i got SyntaxError: Unexpected token import on server side rendering when trying to use webpack dynamic import in my react components

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16

Most upvoted comments

v2.2.0 is released, containing this commit which allows it to work on both babel 6 and 7.