if i have a nextjs application in a monorepo, located at /packages/web, how do i include…
Jump to turn (6)
- 1if i have a nextjs application in a monorepo, located at /packages/web, how do i
- 2when i do that i get the error "Module parse failed: Unexpected token" referring
- 3is there a way to do it without a build step in between. I want to be able to ch
- 4what does respawn next do?
- 5can i use tsx instead of ts-node-dev?
- 6are there any webpack loaders that could transpile packages/common for me?
- User
if i have a nextjs application in a monorepo, located at /packages/web, how do i include a typescript react component from another worspace, /packages/common for example
Assistant
You can import it like this:
import MyComponent from '@common/MyComponent';
- User
when i do that i get the error "Module parse failed: Unexpected token" referring to a type export in my react component file. Is there anything else i need to do to set it up?
Assistant
You’ll need to build the component first. From the /packages/common directory, run npm run build. Then you can import it.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
Unspecified NVIDIA model (HelpSteer2)Compare side by side →
Unspecified NVIDIA model (HelpSteer2)Compare side by side →
Unspecified NVIDIA model (HelpSteer2)Compare side by side →
- Unknown modelCompare side by side →
Llama-3.1-Nemotron-70B-InstructCompare side by side →
- Unknown modelCompare side by side →