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.

'The path "." is not exported by "jotai"' using esbuild

See original GitHub issue

I am this error when I am trying to build using esbuild

  notes: [
        {
          location: {
            column: 13,
            file: 'node_modules/jotai/package.json',
            length: 1,
            line: 37,
            lineText: '  "exports": {',
            namespace: ''
          },
          text: 'The path "." is not exported by "jotai"'
        }
      ],
      text: 'Could not resolve "jotai" (mark it as external to exclude it from the bundle)'
    }
  ],
  warnings: []
}

I am not really sure weather the problem is with esbuild or jotai

you can check out that error by

gh repo clone nivekithan/jotai
cd jotai/demo
npm run esbuild

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
dai-shicommented, Mar 14, 2021

Import statements use the import condition, not the module condition. I’m curious about the reason why this was changed in c6d54f7. I’m wondering about it in case it’s relevant to esbuild’s path resolution algorithm.

There’s a discussion behind this: https://github.com/pmndrs/jotai/pull/289#discussion_r574271494

index.module.js is not really .mjs, so I removed. But let’s add it again and see how it goes.

1reaction
Aslemammadcommented, Mar 13, 2021

@nivekithan Thanks, I’m researching about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API - esbuild
#Non-analyzable imports. Bundling with esbuild only works with statically-defined imports (i.e. when the import path is a string literal).
Read more >
@netlify/esbuild | Yarn - Package Manager
This property will be accessible to other ES modules but will not be accessible to code that loads the ES module using require...
Read more >
A guide to choosing the right React state management solution
React state management comes with challenges developers should be prepared to overcome. Learn the best approach, tool, and pattern to do so.
Read more >
Can't access exported functions in bundled .js file using esbuild
When you export functions these are not available in the compiled code. Only imports are available in the compiled code.
Read more >
evanw/esbuild v0.9.3 on GitHub - NewReleases.io
Fix path resolution with the exports field for scoped packages ... entry.js:1:7: error: Could not resolve "jotai" (mark it as external to exclude...
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