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.

babel 7 with dynamic requires does not work

See original GitHub issue

🐛 Bug Report

When using Babel 7, Jest does not transform dynamic required files. Babel 6 works as expected.

This is a continuation of https://github.com/facebook/jest/issues/7021.

Link to repl or repo (highly encouraged)

chrisblossom/jest-issue-7438

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS 10.14.1
    CPU: (16) x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
  Binaries:
    Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
    npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm
  npmPackages:
    jest: 23.6.0 => 23.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
42tgcommented, Nov 30, 2018

You have to add an custom transformer to solve this Babel 7 issues… I have added a Pull request to your repository wich solves it

1reaction
chrisblossomcommented, Jan 11, 2019

I just wanted to confirm that this issue has been fixed with jest@24.0.0-alpha.12. Thank you!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 7 and preset-es2015 don't work together - Stack Overflow
Now, running NODE_ENV=development node bootstrap.js gives me another error: Error: Requires Babel "^7.0.0-0", ...
Read more >
babel-plugin-dynamic-import-node-babel-7 - npm - Snyk
Babel plugin to transpile import() to a deferred require(), for node For more information about how to use this package see ... No...
Read more >
babel-plugin-dynamic-import-node | Yarn - Package Manager
Babel plugin to transpile import() to a deferred require() , for node. Matches the proposed spec. NOTE: Babylon >= v6.12.0 is required to...
Read more >
dynamic import can only be supported when transforming es ...
Would you like to work on a fix? How are you using Babel? @babel/cli. Input code. Anything. Configuration file name. No response. Configuration....
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