We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It would be great to use TS as much as possible in the project, right now we are using env.js file because we import it in next.config.js
env.js
next.config.js
Newer versions of Next.js seem to support ESM in next.config.ts file.
next.config.ts
I suggest migrating from next.config.js to next.config.ts and to be able to convert env.js to env.ts as well.
env.ts
The alternative is to continue using JS files with TS definitions in comments, but I don't think this is the cleaner approach.
No response
The text was updated successfully, but these errors were encountered:
You have a source on this? Still fails on 15.2.4 for me when using ESM-only stuff:
15.2.4
Sorry, something went wrong.
` async function createNextConfig(): Promise { const { createJiti } = await import('jiti') const jiti = createJiti(fileURLToPath(import.meta.url))
// Import env or other files here, within the async function await jiti.import('./src/constants/env.ts')
return {}, // next js configuration } }
export default (async () => withBundleAnalyzer(await createNextConfig()))() `
here's the workaround... https://github.com/BinarySenseiii/next-clean/blob/main/next.config.ts @martin-eq
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
It would be great to use TS as much as possible in the project, right now we are using
env.js
file because we import it innext.config.js
Newer versions of Next.js seem to support ESM in
next.config.ts
file.Describe the solution you'd like to see
I suggest migrating from
next.config.js
tonext.config.ts
and to be able to convertenv.js
toenv.ts
as well.Describe alternate solutions
The alternative is to continue using JS files with TS definitions in comments, but I don't think this is the cleaner approach.
Additional information
No response
The text was updated successfully, but these errors were encountered: