Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yutak23
Copy link
Contributor

@yutak23 yutak23 commented Nov 9, 2023

This ought to fix #698.

I think, error is related to the way TypeScript and Node.js handle module resolution and imports, particularly in relation to the ECMAScript modules.

When set to bundler, TypeScript is told that the code will be bundled by another tool, so it loosens the rules with imports, allowing imports without file extensions or with .ts extensions​. This is especially useful for projects that will be bundled using tools like Webpack, Rollup, or others, as it aligns with the way these tools resolve modules.

However, it's important to note that while TypeScript allows for omitting extensions with the bundler option, Node.js and in-browser JavaScript still expect file extensions to be present for ESM. This is because, in the world of ESM, file extensions cannot be omitted​.

@ogzhanolguncu
Copy link
Contributor

ogzhanolguncu commented Nov 10, 2023

Nice catch. Yeah I tested it with CF pages, workers pretty much everywhere and works. Thank you.

Close #698

@ogzhanolguncu ogzhanolguncu merged commit 9a31dd1 into upstash:main Nov 10, 2023
@yutak23 yutak23 deleted the feature/fix-extension branch November 10, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Build Error with ^1.24.0 (SvelteKit, Lucia-Auth and Cloudflare Pages)

2 participants