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

react/jsx-runtime module not found #2

Closed
GitQuist opened this issue Oct 26, 2022 · 3 comments · Fixed by #6
Closed

react/jsx-runtime module not found #2

GitQuist opened this issue Oct 26, 2022 · 3 comments · Fixed by #6

Comments

@GitQuist
Copy link

I'm getting the following build error.
Using React: 17.
Implemented according to guide.

Any idea on how to solve it?

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/usr/folder/project/node_modules/react/jsx-runtime' imported from /Users/usr/folder/project/node_modules/@vercel/analytics/dist/react/index.js Did you mean to import react/jsx-runtime.js?

@yonbergman
Copy link

A workaround that seemed to work for us was to follow this comment
and add next-transpile-modules to the config file

// next.config.js
const withTM = require('next-transpile-modules')(['@vercel/analytics'])
modules.exports = withTM(config)

@filipedeschamps
Copy link

I can confirm the exact same problem. I'm using:

    "@vercel/analytics": "0.1.1",
    "next": "12.3.1",
    "react": "17.0.2",

And Node v16.17.1

@chriswdmr
Copy link
Member

We just published 0.1.2 that resolves this 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

Successfully merging a pull request may close this issue.

4 participants