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

Importing from @tiptap/core causing "Cannot find module '@tiptap_core'" #3055

Closed
yayvery opened this issue Apr 19, 2021 · 2 comments
Closed

Comments

@yayvery
Copy link

yayvery commented Apr 19, 2021

Describe the bug

Importing from @tiptap/core is causing "Cannot find module '@tiptap/core'" (see logs below)

Originally created an issue in the tiptap-next repo (https://github.com/ueberdosis/tiptap-next/issues/287) but the developer thinks it is a Vite issue.

Reproduction

Reproduction: https://github.com/danbeneventano/vite-tiptap-bug

The imports causing the error are in Spoiler.js

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 AMD Ryzen 5 1400 Quad-Core Processor
    Memory: 5.26 GB / 15.93 GB
  Binaries:
    Node: 15.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 2.4.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 7.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 89.0.4389.128
    Edge: Spartan (44.19041.906.0), Chromium (89.0.774.77)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    vite: ^2.1.5 => 2.2.0

Used package manager: yarn 2

Logs

 > node_modules/@tiptap/extension-hard-break/dist/tiptap-extension-hard-break.esm.js:1:38: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
        1  import { Node, mergeAttributes } from '@tiptap/core';
                                                 ~~~~~~~~~~~~~~
   node_modules/vite/dist/node/chunks/dep-8baf35b6.js:65417:18: note: This error came from the "onResolve" callback registered here
    65417              build.onResolve({ filter: /^[\w@][^:]/ }, async ({ path: id, importer, kind, resolveDir }) => {
                             ~~~~~~~~~
    at setup (C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js:65417:19)
    at handlePlugins (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:686:7)
    at Object.buildOrServe (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:903:44)
    at C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:1443:14)
    at Object.build (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:1334:51)
    at optimizeDeps (C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js:65643:34)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

error when starting dev server:
Error: Build failed with 23 errors:
node_modules/@tiptap/extension-blockquote/dist/tiptap-extension-blockquote.esm.js:1:38: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
node_modules/@tiptap/extension-bold/dist/tiptap-extension-bold.esm.js:1:68: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
node_modules/@tiptap/extension-bubble-menu/dist/tiptap-extension-bubble-menu.esm.js:1:40: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
node_modules/@tiptap/extension-bullet-list/dist/tiptap-extension-bullet-list.esm.js:1:38: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
node_modules/@tiptap/extension-code-block/dist/tiptap-extension-code-block.esm.js:1:21: error: [vite:dep-pre-bundle] Cannot find module '@tiptap_core'
Require stack:
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\chunks\dep-8baf35b6.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\dist\node\cli.js
- C:\Users\Dan\CometDev\vite-project\node_modules\vite\bin\vite.js
...
    at failureErrorWithLog (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:1224:15)
    at buildResponseToResult (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:936:32)
    at C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:1035:20
    at C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:568:9
    at handleIncomingPacket (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:657:9)
    at Socket.readFromStdout (C:\Users\Dan\CometDev\vite-project\node_modules\esbuild\lib\main.js:535:7)
    at Socket.emit (node:events:378:20)
    at addChunk (node:internal/streams/readable:313:12)
    at readableAddChunk (node:internal/streams/readable:288:9)
    at Socket.Readable.push (node:internal/streams/readable:227:10)
@Shinigami92
Copy link
Member

Shinigami92 commented Apr 19, 2021

Could you try our hotfix 2.2.1?

This may be fixed with #3053

@yayvery
Copy link
Author

yayvery commented Apr 19, 2021

Could you try our hotfix 2.2.1?

This may be fixed with #3053

2.2.1 fixed it! Error only occurs with 2.2.0 and lower.

@yayvery yayvery closed this as completed Apr 19, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants