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

TypeError: DtsCreator is not a constructor #197

Open
dozortsev opened this issue Apr 19, 2023 · 1 comment
Open

TypeError: DtsCreator is not a constructor #197

dozortsev opened this issue Apr 19, 2023 · 1 comment

Comments

@dozortsev
Copy link

dozortsev commented Apr 19, 2023

Hey @Quramy

I run into following error when try to use this lib via programatic API

$ node scripts/types.mjs
.../css/scripts/types.mjs:5

const creator = new DtsCreator();
                ^

TypeError: DtsCreator is not a constructor
    at file:///Users/anton.dozortsev/Documents/Wise/code/neptune-web/packages/css/scripts/types.mjs:5:17
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:526:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)
error Command failed with exit code 1.

I also tried following

const creator = DtsCreator();

creator.create('.../../file.css').then((content) => {

but it doesn't work

.../css/scripts/types.mjs:5
const creator = DtsCreator();
                ^
TypeError: DtsCreator is not a function

any change you could help, e.g point out what could be wrong, I'm happy to contribute 🙂

@dozortsev dozortsev changed the title TypeError: DtsCreator is not a constructor TypeError: DtsCreator is not a constructor Apr 19, 2023
@evoactivity
Copy link
Contributor

This works for me

import DtsCreator from 'typed-css-modules';
const creator = new DtsCreator.default();

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

2 participants