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

The switch to commonjs module compilation is incompatible with "type": "module" #127

Open
taylorhadden opened this issue Feb 8, 2023 · 3 comments

Comments

@taylorhadden
Copy link
Contributor

I am in the process of updating typewriter to 0.7.16 in my project. With the switch to using a commonjs output, webpack cannot import from sub-directories (e.g. import { h } from 'typewriter-editor/lib/rendering/vdom').

I was able to fix this by removing "type": "module" in package.json. Looks like typewriter needs to be a commonjs module through-and-through or the js files it produces need to be .cjs.

@taylorhadden
Copy link
Contributor Author

Removing "type": "module" breaks all building scripts (obvious, in retrospect).

I was able to get importing & building to work by adding a package.json with nothing but { "type": "commonjs" } in the ./lib/ folder.

@tomconnors
Copy link

I was also unable to use version 0.7.16 due to this issue. 0.7.15 works.

With 0.7.16, attempts to import Typewriter's modules (in a typical Svelte + Typescript project) resulted in an error along the lines of "exports is not defined".

@FluffyDiscord
Copy link

FluffyDiscord commented May 11, 2023

The 0.7.16 is broken - I am getting Uncaught ReferenceError: exports is not defined on a clean npx create-vite project.

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