turbo icon indicating copy to clipboard operation
turbo copied to clipboard

Issues while building a React App

Open sedric-eyal-peleg opened this issue 2 years ago • 2 comments

What version of Turborepo are you using?

1.3.1

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Describe the Bug

Context - we are transitioning to a monorepo using Turborepo with React and Cypress apps.

While building the React app using the npm run build command we are receiving the following error:

:build: Module not found: Error: Can't resolve './version' in '/Users/****/Projects/****/app/node_modules/graphql'
:build: Did you mean 'version.mjs'?
:build: BREAKING CHANGE: The request './version' failed to resolve only because it was resolved as fully specified
:build: (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
:build: The extension in the request is mandatory for it to be fully specified.
:build: Add the extension to the request.

What we have tried so far:

Modifying the package.json type property to either commonjs or module. Modifying the actual line in the aforementioned package to have the specified suffix. Thanks in advance!

Expected Behavior

A regular build of the React app.

To Reproduce

  1. have a react app using CRA: "@craco/craco": "^6.4.3", "react": "^17.0.2"
  2. Install Graphql in the react app: "graphql": "^15.5.0"
  3. Install turborepo 1.3.1
  4. run npm run build

sedric-eyal-peleg avatar Jul 06 '22 10:07 sedric-eyal-peleg

At what scope are you executing the command. In my project, running from "scope of turbo" not of the "workspace app" solved these issues.

dainissilamikelis avatar Jul 22 '22 06:07 dainissilamikelis

I'm not sure this is a turborepo issue. Could you provide a repo that reproduces if you would like more help?

mehulkar avatar Sep 08 '22 00:09 mehulkar

Closing this down. Feel free to post more info or open a new issue if you're still seeing this @sedric-eyal-peleg!

mehulkar avatar Oct 25 '22 09:10 mehulkar