Packages with dir as "main" in package.json do not resolve.
See original GitHub issueWhen 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:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
??
@zavr-1 It’s going to be a bit before I can get to this. Webpack4 support is currently taking all my time.