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

esbuild no longer respects target in tsconfig.json #6633

Closed
ryanwoodcox opened this issue Jun 17, 2023 · 4 comments
Closed

esbuild no longer respects target in tsconfig.json #6633

ryanwoodcox opened this issue Jun 17, 2023 · 4 comments

Comments

@ryanwoodcox
Copy link

ryanwoodcox commented Jun 17, 2023

Have you experienced this bug with the latest version of the template?

Yes

Steps to Reproduce

  • Run npm run build
  • Read the warnings:
> build
> run-s build:*


> build:remix
> remix build

Building Remix app in production mode...
▲ [WARNING] "tsconfig.json" does not affect esbuild's own target setting [tsconfig.json]

    tsconfig.json:13:4:
      13 │     "target": "ES2019",
         ╵     ~~~~~~~~

  This is because esbuild supports reading from multiple "tsconfig.json" files within a single
  build, and using different language targets for different files in the same build wouldn't be
  correct. If you want to set esbuild's language target, you should use esbuild's own global
  "target" setting such as with "target: 'es2019'".

According to the esbuild v0.18.0 release notes:

TypeScript's target no longer affects esbuild's target (evanw/esbuild#2628)

Some people requested that esbuild support TypeScript's target setting, so support for it was added (in version 0.12.4). However, esbuild supports reading from multiple tsconfig.json files within a single build, which opens up the possibility that different files in the build have different language targets configured. There isn't really any reason to do this and it can lead to unexpected results. So with this release, the target setting in tsconfig.json will no longer affect esbuild's own target setting. You will have to use esbuild's own target setting instead (which is a single, global value).

Expected Behavior

  • npm run build
  • No build warnings produced

Actual Behavior

Build does not respect the target and produces warnings.

@MichaelDeBoey MichaelDeBoey transferred this issue from remix-run/blues-stack Jun 18, 2023
@meza
Copy link

meza commented Jun 18, 2023

I've tried setting the target with the remix-esbuild-override setup I've got going on but no luck.

@tonymartin-dev
Copy link

Same error here after updating to v1.17 and integrating vanilla-extract in our project.

@janstuemmel
Copy link

How can i supress this warning?

@pcattori
Copy link
Contributor

Cannot reproduce on 1.19.2 nor nightly with "target": "ES2019" set in tsconfig.json.

Note that Remix is pinned to esbuild v0.17.6, so you may want to check if you have multiple versions of esbuild installed locally and if the wrong one is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: External
Development

No branches or pull requests

6 participants