question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Cannot find module '@babel/plugin-syntax-dynamic-import'

See original GitHub issue

šŸ› Bug Report

When in server-side-rendering example, unable to start project due to:

loadable-components/examples/server-side-rendering/babel.config.js: Error while loading config - Cannot find module ā€˜@babel/plugin-syntax-dynamic-importā€™ at Function.Module._resolveFilename (module.js:536:15) at Function.Module._load (module.js:466:25) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at Object.<anonymous> (loadable-components/packages/babel-plugin/lib/index.js:6:57) at Module._compile (module.js:635:30) at Module._compile (loadable-components/examples/server-side-rendering/node_modules/pirates/lib/index.js:83:24) at Module._extensionsā€¦js (module.js:646:10) at Object.newLoader [as .js] (loadable-components/examples/server-side-rendering/node_modules/pirates/lib/index.js:88:7) at Module.load (module.js:554:32) [nodemon] app crashed - waiting for file changes before startingā€¦ [nodemon] restarting due to changesā€¦ [nodemon] starting babel-node src/server/main.js loadable-components/examples/server-side-rendering/node_modules/@babel/core/lib/config/files/configuration.js:206 throw err;

To Reproduce

  • Clone git repository.

  • Go into root dir loadable-components and run npm install

  • Go into examples/server-side-rendering and run npm install

  • Go back to root dir loadable-components and run yarn build I get the following after yarn build completes: lerna success run Ran npm script ā€˜buildā€™ in 4 packages: lerna success - @loadable/babel-plugin lerna success - @loadable/component lerna success - @loadable/server lerna success - @loadable/webpack-plugin

  • Go into examples/server-side-rendering and run yarn dev and get the error: loadable-components/examples/server-side-rendering/babel.config.js: Error while loading config - Cannot find module ā€˜@babel/plugin-syntax-dynamic-importā€™ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15) at Function.Module._load (internal/modules/cjs/loader.js:506:25) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (loadable-components/packages/babel-plugin/lib/index.js:6:57) at Module._compile (internal/modules/cjs/loader.js:688:30) at Module._compile (loadable-components/examples/server-side-rendering/node_modules/pirates/lib/index.js:83:24) at Module._extensionsā€¦js (internal/modules/cjs/loader.js:699:10) at Object.newLoader [as .js] (loadable-components/examples/server-side-rendering/node_modules/pirates/lib/index.js:88:7) at Module.load (internal/modules/cjs/loader.js:598:32) [nodemon] app crashed - waiting for file changes before startingā€¦

Expected behavior

I expected the server-side-rendering example to start.

Link to repl or repo (highly encouraged)

Please provide a minimal repository on GitHub. https://github.com/gcardella/loadable-components.git

Issues without a reproduction link are likely to stall.

Run npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard

Paste the results here:

System:

  • OS: macOS High Sierra 10.13.6
  • CPU: (4) x64 IntelĀ® Coreā„¢ i5-4258U CPU @ 2.40GHz
  • Memory: 116.87 MB / 4.00 GB
  • Shell: 3.2.57 - /bin/bash

Binaries:

  • Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
  • Yarn: 1.12.3 - /usr/local/bin/yarn
  • npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
  • Watchman: 4.7.0 - /usr/local/bin/watchman

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gcardellacommented, Feb 4, 2019

rm -rf loadable-components. peace.

1reaction
dlebedynskyicommented, Jan 7, 2019

@gcardella looking at your issue, First problem I see is that you are mixing both yarn (including lerna) and npm (lock file) . and there are seem to be issues with yarn install in your repo. specifically related to unpublished error https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.6.tgz. can you please update to latest from master and remove unnecessary added lock files?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpacker error related to module babel-plugin-syntax ...
<path_to_my_app>/node_modules/@babel/plugin-syntax-dynamic-import/ is installed. Similar issues reported in SO, but I think I've tried them all.
Read more >
Cannot find module '@babel/plugin-syntax-dynamic-import ...
The problem comes from how yarn workspaces hoists dependencies. ... Yarn workspace will hoist the dependencies to the root node_modules ifĀ ...
Read more >
babel/plugin-syntax-dynamic-import
Working with Webpack and @babel/preset-env. Currently, @babel/preset-env is unaware that using import() with Webpack relies on Promise internally.
Read more >
@babel/plugin-syntax-dynamic-import - npm
Start using @babel/plugin-syntax-dynamic-import in your project by running `npm i @babel/plugin-syntax-dynamic-import`.
Read more >
@babel/plugin-syntax-dynamic-import Code Examples | Snyk
module.exports = function () { var template = require("@babel/template")Ā ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found