turbo icon indicating copy to clipboard operation
turbo copied to clipboard

[turborepo] Error with vanilla install

Open joshrouwhorst opened this issue 3 years ago • 3 comments

What version of Turborepo are you using?

1.6.2

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

npm

What operating system are you using?

Mac

Describe the Bug

When I open http://localhost:3000 in the browser I get a Failed to Compile error:

../../packages/ui/Button.tsx
Module parse failed: Unexpected token (3:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import * as React from "react";
| export const Button = () => {
>   return <button>Boop</button>;
| };
|

Expected Behavior

http://localhost:3000 should display the web app with the Button component without error.

To Reproduce

  1. Install a default turborepo with npx create-turbo@latest
  2. Select default 'my-turborepo' name
  3. Select 'npm' (though, I also had this error with yarn)
  4. cd my-turborepo
  5. npm run dev
  6. Open http://localhost:3000

Reproduction Repo

No response

joshrouwhorst avatar Oct 29 '22 18:10 joshrouwhorst

I just tried running npx [email protected] and npx [email protected] and those worked fine.

joshrouwhorst avatar Oct 29 '22 18:10 joshrouwhorst

Project created with npx create-turbo@latest gives me "next": "12.3.1" in apps/web/package.json, however it seems that the experiment.transpilePackages property doesn't get supported until the 12.3.2 canary versions. My console also emits warnings saying that transpilePackages property is unexpected.

image

Don't know if this is the right way or not, but changing "next": "12.3.1" to "next": "13.0.0" in both apps/web/package.json and apps/docs/package.json, then run npm install in apps/web and apps/docs, does eliminate the warning and solved the issue.

GalvinGao avatar Oct 29 '22 18:10 GalvinGao

Don't know if this is the right way or not, but changing "next": "12.3.1" to "next": "13.0.0" in both apps/web/package.json and apps/docs/package.json, then run npm install in apps/web and apps/docs, does eliminate the warning and solved the issue.

Worth updating to "eslint-config-next": "13.0.0" in eslint-config-custom too.

lewispeel avatar Oct 29 '22 21:10 lewispeel