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

Error - Module '"jsep"' has no exported member 'Jsep' #237

Open
HimanshuGoel opened this issue Dec 14, 2022 · 3 comments
Open

Error - Module '"jsep"' has no exported member 'Jsep' #237

HimanshuGoel opened this issue Dec 14, 2022 · 3 comments

Comments

@HimanshuGoel
Copy link

I am getting an error Module '"jsep"' has no exported member 'Jsep' while importing the Jsep library by using the below statement -

import { Jsep } from 'jsep';

image

I am using the 1.3.8 version of Jsep library in a standard Angular 15 application.

However, it works fine when I use the default import syntax -

import jsep from 'jsep';

I have also created a minimal reproduction example on Github. Please refer to this link to open it on Stackblitz - https://stackblitz.com/github/HimanshuGoel/issues-reproduction-app/tree/jsep-issue-with-import?file=src%2Fapp%2Fapp.component.ts

@benatkin
Copy link

Looks like Jsep isn't included in TypeScript, but both of these work:

import * as jsep from 'jsep'
const { Jsep } = jsep
console.log(Jsep.parse('1 + 1'))
import { Jsep } from 'jsep'
console.log(Jsep.parse('1 + 1'))

If you look at the git log, it looks like the types are manually built: https://github.com/EricSmekens/jsep/commits/master/typings/tsd.d.ts

@6utt3rfly
Copy link
Collaborator

#198 proposed some updates to the typings, but the review comments indicate that it broke some of the other usages of jsep with cjs and esm. Would be great if someone wanted to create a PR?

@benatkin
Copy link

I suggest just using the jsep() API.

I don't have a use case for being able to use Jsep.parse in TypeScript the but I might have a use case for #211. I don't know yet. I think a fix for #211 could make this one easier.

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