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.

Packages with dir as "main" in package.json do not resolve.

See original GitHub issue

When trying to import a package that has a directory as its “main” field, there will be an error

example/example2.js:3: ERROR - Failed to load module "abc"
import abc from 'abc'
^
1 error(s), 0 warning(s)
node_modules
|-abc
  |-build
    -- index.js
  --package.json

cat package.json

{"name":"abc", "main":"build"}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zavr-1commented, Dec 4, 2018

??

0reactions
ChadKillingsworthcommented, Dec 6, 2018

@zavr-1 It’s going to be a bit before I can get to this. Webpack4 support is currently taking all my time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Package.json - set main directory - Stack Overflow
I know the files parameter just determines which directories are included in the export, so that doesn't work, and it appears that main...
Read more >
Main property in package.json defines package entry point
json file and checks if it contains a main property. It will be used to point a file inside the package directory that...
Read more >
package.json - npm Docs
New packages must not have uppercase letters in the name. The name ends up being part of a URL, an argument on the...
Read more >
Dependency resolution - Parcel
If the directory contains a package.json file, the main entry will be resolved as described in the Package entries section. If no package.json...
Read more >
What Is package.json? | heynode.com
From this list, npm knows what packages to fetch and install (and at what versions) when npm install is run in the directory....
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