Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve '...' #22

Closed
TuKun33 opened this issue May 4, 2024 · 6 comments
Closed

Module not found: Error: Can't resolve '...' #22

TuKun33 opened this issue May 4, 2024 · 6 comments

Comments

@TuKun33
Copy link

TuKun33 commented May 4, 2024

import { TextEditor } from 'mui-tiptap-editor';

ERROR in ./src/components/RichEditor/index.jsx 10:30-40
export 'TextEditor' (imported as 'TextEditor') was not found in 'mui-tiptap-editor' (module has no exports)

ERROR in ./node_modules/mui-tiptap-editor/dist/esm/index.js 1:0-64
Module not found: Error: Can't resolve './components/TextEditor' in 'C:\Users\Tukun\Documents\Workspace\YeIo\ayatt-admin-ui\node_modules\mui-tiptap-editor\dist\esm'
Did you mean 'TextEditor.js'?
BREAKING CHANGE: The request './components/TextEditor' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/mui-tiptap-editor/dist/esm/index.js 2:0-80
Module not found: Error: Can't resolve './components/TextEditorReadOnly' in 'C:\Users\Tukun\Documents\Workspace\YeIo\ayatt-admin-ui\node_modules\mui-tiptap-editor\dist\esm'
Did you mean 'TextEditorReadOnly.js'?
BREAKING CHANGE: The request './components/TextEditorReadOnly' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/mui-tiptap-editor/dist/esm/index.js 3:0-58
Module not found: Error: Can't resolve './components/Toolbar' in 'C:\Users\Tukun\Documents\Workspace\YeIo\ayatt-admin-ui\node_modules\mui-tiptap-editor\dist\esm'
Did you mean 'Toolbar.js'?
BREAKING CHANGE: The request './components/Toolbar' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
@tiavina-mika
Copy link
Owner

which version are you using?

@tiavina-mika
Copy link
Owner

fixed, please update to the latest version with yarn add mui-tiptap-editor@latest

@TuKun33
Copy link
Author

TuKun33 commented May 5, 2024

fixed, please update to the latest version with yarn add mui-tiptap-editor@latest

Thanks! I have updated the latest version 0.3.2, but it still has the same error, which seems to be similar to this issue

@tiavina-mika
Copy link
Owner

can you please provide your environment?
Node version
npm or yarn version
mui version

@TuKun33
Copy link
Author

TuKun33 commented May 15, 2024

can you please provide your environment? Node version npm or yarn version mui version

Node v20.12.2
npm v10.5.0
mui v5.10.5

@tiavina-mika
Copy link
Owner

It's a typescript issue,
The import should have an extension.

import x from "./mymodule"

should be

import x from "./mymodule.js"

There are well known debates in related issues requests opened for the tsc team on GitHub #27481 and #11901, but with no resolutions.

So as for now my solution is using this lib: ts-add-js-extension.

So upgrade to the latest mui-tiptap-editor version would fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants