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

add package react-dom in nextjs/legacy example #295

Closed

Conversation

eddie0329
Copy link
Contributor

Proposed Release Notes

  • Due to missing package error occured, Add missing package react-dom in nextjs/legacy example

Links

Details

@CLAassistant
Copy link

CLAassistant commented Sep 9, 2024

CLA assistant check
All committers have signed the CLA.

@@ -10,7 +10,8 @@
"newrelic": "^12.0.0",
"next": "^14.1.4",
"pino": "^8.19.0",
"react": "^18.2.0"
"react": "^18.2.0",
"react-dom": "^18.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, but I am not seeing any error mentioning "react-dom" when I follow the instructions in the Readme (npm run build && npm start).

Can you provide a minimal reproduction of the error you are encountering?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsumners-nr Thank you for wonderful lib and reply.
I got same error when running script dev or build and not sure why you got no errors. Assuming "react-dom" installled globally in your environment?

📌 Reproduction 1:

  1. yarn dev or npm run dev
  2. visit localhost:3000

📌 Reproduction 2:

  1. yarn build or npm run build

📌 Error Screenshot:

스크린샷 2024-09-09 오후 8 44 55

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think it's wiered why you got no errors. Next.js requires "react-dom" and there is no "react-dom" in package.json.

스크린샷 2024-09-09 오후 8 51 22

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming "react-dom" installled globally in your environment?

No. It is a dependency of next:

❯ npm ls react-dom
nextjs-legacy@ /Users/jsumners/Projects/team-repos/newrelic-node-examples/nextjs-legacy
└─┬ [email protected]
  └── [email protected]

Running npm install should result in the correct dependencies being installed. Please remove the node_modules directory and run npm install.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reply. It is weired that when i run this project with npm it works. However, when i run it with yarn it requires react-dom.

My yarn version: 1.22.19

How about mention at readme.md that npm package manager is suggested to use?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be okay with a step added between steps 2 and 3 that is "Install dependencies: npm install". Would you like to submit a PR for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap. I will close this pr and make new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

3 participants