这是indexloc提供的服务,不要输入任何密码
Skip to content

Incorrect default type package.json for ui package? #9594

@mastoj

Description

@mastoj

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/mastoj/turborepo-bug

Which canary version will you have in your reproduction?

2.3.4-canary.2

Enviroment information

CLI:
   Version: 2.3.4-canary.2
   Path to executable: /Users/tomas/tmp/my-turborepo/node_modules/turbo-darwin-arm64/bin/turbo
   Daemon status: Running
   Package manager: npm

Platform:
   Architecture: aarch64
   Operating system: macos
   WSL: false
   Available memory (MB): 18299
   Available CPU cores: 12

Environment:
   CI: None
   Terminal (TERM): xterm-256color
   Terminal program (TERM_PROGRAM): vscode
   Terminal program version (TERM_PROGRAM_VERSION): 1.95.3
   Shell (SHELL): /bin/zsh
   stdin: false

Expected behavior

I added a very simple ts-file to explore dependencies and was faced with a lot of small weird issues. I added the file hello.ts with a small function that I wanted to test in the button component. When adding a reference to the file in the button component it asks me to import it as "./hello.js" in VS Code, but having a reference with ".js" did not build.

I expected it to be imported as "./hello" without an error message in VS Code, and I expected that to build.

Actual behavior

I get a error in the IDE while it is still building. If I fix the error in the IDE (VS Code) the build fails.

To Reproduce

Clone repo and open the button.tsx, there you will see an error in the file even though it still builds:

image

Additional context

If you remove the "type": "module" in the package.json in the UI package everything is as I would expect.

Metadata

Metadata

Assignees

Labels

area: examplesImprovements or additions to examples

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions