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.

Doesn't work with nuxt, w3c-keyname error

See original GitHub issue

Describe the bug Added tiptap to existing project via npm, when trying to call a component that holds the editor, I get "No valid exports main found for '[project-path]\node_modules\w3c-keyname'"

Created fresh nuxt project, added tiptap again, same error.

Created fresh vue-cli project, added tiptap, works fine.

Tried this solution with nuxt, didn’t help either.

At this point can’t seem to get tiptap working with nuxt at all.

Screenshots image

Environment

  • OS: Win10
  • Browser Chrome
  • Version 1.27.0
  • Mobile / Desktop: Desktop

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
OrkhanAlikhanovcommented, Apr 21, 2020

If you are not doing server-side rendering of prosemirror document do not import ‘tiptap’ at serverside. Do following instead (not tested):

- import { EditorContent } from 'tiptap'
+ let EditorContent;
+ if (process.browser) EditorContent = require('tiptap')

Or the easiest fix is to stick to version 2.2.2:

npm i w3c-keyname@2.2.2 

FYI @marijnh, @philippkuehn

This addition broke it, removing it fixes the issue: https://github.com/marijnh/w3c-keyname/blob/e9fe840569bd2e090a4686436b918aa30ac49d51/package.json#L7-L10

w3c-keyname is imported by prosemirror-keymap

1reaction
xuannghiacommented, Apr 21, 2020

I am using v13.5 and also get the same error

Welcome to Node.js v13.5.0.
Type ".help" for more information.
> require("w3c-keyname")
Uncaught:
Error: No valid exports main found for '/Users/xxx/test/node_modules/w3c-keyname'
    at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18) {
  code: 'MODULE_NOT_FOUND'
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't work with nuxt, w3c-keyname error · Issue #665 - GitHub
Describe the bug Added tiptap to existing project via npm, when trying to call a component that holds the editor, I get "No...
Read more >
nuxtjs vuejs @error is not firing in a component when trying to ...
I have a component that I feed with props. When an image throws a 404 I want to load a fallback image. So...
Read more >
w3c-keyname - npm
Start using w3c-keyname in your project by running `npm i w3c-keyname`. There are 48 other projects in the npm registry using w3c-keyname.
Read more >
Prose Mirror, buildless! (ESM support)
Unfortunately, PM published NPM packages do not work buildless with modern web apps. ... prosemirror-keymap -> w3c-keyname.
Read more >
package subpath is not defined by exports in - You.com
If problem persist, issue a npm install --save multiformats@9.9.0 and see if this correct your problem or not. Open side panel. Next-auth Package...
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