Skip to content

fix: unclear error when run cts config without ts-node in rtk-query-codegen-openapi#4446

Merged
markerikson merged 3 commits into
reduxjs:masterfrom
lawvs:patch-1
Aug 30, 2024
Merged

fix: unclear error when run cts config without ts-node in rtk-query-codegen-openapi#4446
markerikson merged 3 commits into
reduxjs:masterfrom
lawvs:patch-1

Conversation

@lawvs

@lawvs lawvs commented Jun 6, 2024

Copy link
Copy Markdown
Contributor

Related to #2437 #2438

When you use cts without ts-node in rtk-query-codegen-openapi, the error message is unclear and difficult to troubleshoot.

Before

(node:56745) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)

/Users/user/project/openapi-config.cts:1
import type { ConfigFile } from '@rtk-query/codegen-openapi'
^^^^^^

SyntaxError: Cannot use import statement outside a module

After

Encountered a TypeScript configfile, but neither esbuild-runner nor ts-node are installed.

@codesandbox

codesandbox Bot commented Jun 6, 2024

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@codesandbox-ci

codesandbox-ci Bot commented Jun 6, 2024

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 993afd2:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@netlify

netlify Bot commented Jun 6, 2024

Copy link
Copy Markdown

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 2e6dcf0
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/6661836ca26f580008a084eb
😎 Deploy Preview https://deploy-preview-4446--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify

netlify Bot commented Jun 6, 2024

Copy link
Copy Markdown

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit b73c040
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/66703c53fd08ba0008bc4360
😎 Deploy Preview https://deploy-preview-4446--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@EskiMojo14

Copy link
Copy Markdown
Collaborator

thanks - for future proofing, could you also add detection of .mts?

@codesandbox-ci

codesandbox-ci Bot commented Jun 6, 2024

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 32756db:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

@lawvs lawvs changed the title fix: unclear error when run cts config without ts-node fix: unclear error when run cts config without ts-node in rtk-query-codegen-openapi Jun 6, 2024
@lawvs

lawvs commented Jun 7, 2024

Copy link
Copy Markdown
Contributor Author

thanks - for future proofing, could you also add detection of .mts?

Done!

@codesandbox-ci

codesandbox-ci Bot commented Jun 17, 2024

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b73c040:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

lawvs and others added 3 commits June 17, 2024 13:37
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: OverflowCat <overflowcat@gmail.com>
@markerikson markerikson merged commit 37328ca into reduxjs:master Aug 30, 2024
@markerikson markerikson added the RTKQ-Codegen Issues related to the @rtk-query/codegen-openapi package. label Aug 30, 2024
@markerikson

Copy link
Copy Markdown
Collaborator

Should be live in https://github.com/reduxjs/redux-toolkit/releases/tag/%40rtk-query%2Fcodegen-openapi%402.0.0-alpha.0 ! Please try it out and let us know if it works.

@lawvs lawvs deleted the patch-1 branch August 31, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RTKQ-Codegen Issues related to the @rtk-query/codegen-openapi package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants