Errors using @tomic/react in js project - Was not found in "module has no exports" type
joepio opened this issue · 3 comments
joepio commented
@studium.dev just noticed this in https://github.com/jerlendds/atomic-data-client
Failed to compile.
Attempted import error: 'Store' is not exported from '@tomic/react' (imported as 'Store').
WARNING in ./node_modules/.pnpm/@tomic+lib@0.34.0/node_modules/@tomic/lib/dist/src/index.js
Module Warning (from ./node_modules/.pnpm/source-map-loader@3.0.2_webpack@5.75.0/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/mellow/Projects/studium.dev/frontend/node_modules/.pnpm/@tomic+lib@0.34.0/node_modules/@tomic/lib/src/index.ts' file: Error: ENOENT: no such file or directory, open '/home/mellow/Projects/studium.dev/frontend/node_modules/.pnpm/@tomic+lib@0.34.0/node_modules/@tomic/lib/src/index.ts'
- Probably has to do with filename extensions. Changing these in
index.js
from./hooks
to/hooks.js
for example introduced new errors - I vaguely remember removing the extensions some time ago... @Polleps I remember we had a discussion about this, do you know what the considerations were?
- https://www.typescriptlang.org/docs/handbook/module-resolution.html
jerlendds commented
joepio commented
Is probably caused by typescript not creating valid JS files:
joepio commented
Fixed, was a tsc
problem due to moduleResolution
and lack of .js
extensions in imports