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

bug: rollup plugin typescript 4.5-beta - 4.6 json import with node12 node14 nodenext resolve modes #1020

Closed
frank-dspeed opened this issue Oct 13, 2021 · 6 comments

Comments

@frank-dspeed
Copy link
Contributor

frank-dspeed commented Oct 13, 2021

  • Rollup Plugin Name: typescript
  • Rollup Plugin Version: *
  • Rollup Version: *
  • Operating System (or Browser): *
  • Node Version: *
  • Link to reproduction (⚠️ read below):

Expected Behavior

Actual Behavior

!] (plugin typescript) Error: @rollup/plugin-typescript TS5070: Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.
Error: @rollup/plugin-typescript TS5070: Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy.
    at error (/home/frank/Projekte/rollup/node_modules/rollup/dist/shared/rollup.js:158:30)
    at throwPluginError (/home/frank/Projekte/rollup/node_modules/rollup/dist/shared/rollup.js:21741:12)
    at Object.error (/home/frank/Projekte/rollup/node_modules/rollup/dist/shared/rollup.js:22415:20)
    at emitDiagnostic (/home/frank/Projekte/rollup/node_modules/@rollup/plugin-typescript/dist/index.js:511:17)
    at reportDiagnostics (/home/frank/Projekte/rollup/node_modules/@rollup/plugin-typescript/dist/index.js:519:9)
    at Array.forEach (<anonymous>)
    at emitFilesAndReportErrors (/home/frank/Projekte/rollup/node_modules/typescript/lib/typescript.js:119781:21)
    at Object.result.afterProgramCreate (/home/frank/Projekte/rollup/node_modules/typescript/lib/typescript.js:119959:13)
    at Object.afterProgramCreate (/home/frank/Projekte/rollup/node_modules/@rollup/plugin-typescript/dist/index.js:674:29)
    at synchronizeProgram (/home/frank/Projekte/rollup/node_modules/typescript/lib/typescript.js:120256:22)

Additional Information

support for moduleResolution node12 and nodenext is needed

Update

This is now expected to land with ts4.6 and it is also fixed and verifyed already.

@shellscape
Copy link
Collaborator

shellscape commented Oct 13, 2021

Looks like you wanted a feature request issue. Could you please update the template and provide all of the requested details?

@frank-dspeed
Copy link
Contributor Author

not an rollup issue needs to get fixed in typescript

@typhonrt
Copy link

@frank-dspeed et al. I think this should be reopened. On lines 48-50 of normalize.ts. If one specifies module as nodenext or node12 it is coerced to esnext in the default condition.

Given the peer dependency for @rollup/plugin-typescript being so low the only thing I can think of is adding in case statements with the actual value for nodenext and node12 for the module compiler option.
nodenext is 199
node12 is 100

@frank-dspeed
Copy link
Contributor Author

frank-dspeed commented Nov 30, 2021

@shellscape no it was not a request read the following if your interrested.
@typhonrt no your getting it wrong this was about our own builds of rollup/rollup it is about json imports and i was testing the rollup/rollup build with a new Experimental TypeScript version that will not get released as is in the mean while it got fixed on the TypeScript side:

but this will maybe first time happen with typescript 4.6 and 4.5 will not have the new node12 and nodenext module modes

@typhonrt
Copy link

Hi @frank-dspeed I just misread your post. Indeed I should file another issue, but indeed what I mentioned pertains to node12 / nodenext support w/ @rollup/plugin-typescript.

@frank-dspeed
Copy link
Contributor Author

@typhonrt your correct but you should not fill that issue unless your affilated with typescript in anyway if you want to take that job you can do it else i do it. I am working on typescript-rollup a typescript version with a rollup compatible ast that also can get queryed via a api.

You can See it a bit as Distributed Rollup and Typescript thats why i am following the typescript and rollup development.

@frank-dspeed frank-dspeed changed the title bug: rollup plugin typescript bug: rollup plugin typescript 4.5-beta - 4.6 json import with node12 node14 nodenext resolve modes Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants