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.

CJS module import is broken on latest

See original GitHub issue

Describe the bug Latest CJS packages seem to be broken (9.3.3). Using 9.2.1 works. See codesandbox or the log below:

[ error ] ./node_modules/react-dnd-cjs/lib/common/DndContext.js
Module not found: Can't resolve 'dnd-core' in '/mnt/c/dev/foobar/app/node_modules/react-dnd-cjs/lib/common'
{ Error: Cannot find module 'dnd-core'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)

Reproduction

https://codesandbox.io/embed/wonderful-turing-mqywk

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:29 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
darthtrevinocommented, Aug 6, 2019

I’m out until the 20th - feel free to reopen this if the problem persists. Thanks!

2reactions
darthtrevinocommented, Aug 6, 2019

I’m removing the absolute URLs from the create_packages script, it should be up in a minute

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node Modules at War: Why CommonJS and ES ... - Code Red
ESM scripts can import CJS scripts, but only by using the “default import” syntax import _ from 'lodash' , not the “named import”...
Read more >
How to fix Must use import to load ES Module discord.js
1. The solution is in the error message: Instead rename index.js to end in . · node-fetch version 3 (current latest) wont allow...
Read more >
CommonJS modules | Node.js v19.3.0 Documentation
The module.exports property can be assigned a new value (such as a function or object). Below, bar.js makes use of the square module,...
Read more >
JS Fix For "SyntaxError: Cannot Use Import Statement Outside ...
This is most likely triggered when a file tries to use both import and require module patterns, which isn't possible. You'll need to...
Read more >
JavaScript modules - MDN Web Docs
Renaming imports and exports. Inside your import and export statement's curly braces, you can use the keyword as along with a new feature...
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