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

Uncaught ReferenceError: exports is not defined #2

Open
mogadanez opened this issue Nov 3, 2017 · 4 comments
Open

Uncaught ReferenceError: exports is not defined #2

mogadanez opened this issue Nov 3, 2017 · 4 comments

Comments

@mogadanez
Copy link

mogadanez commented Nov 3, 2017

Sample work with sample worker,
but when I add any import in my worker code, it starts failed with

Uncaught ReferenceError: exports is not defined

I also see
Object.defineProperty(exports, "__esModule", { value: true });
in generated code

@mohyeid
Copy link

mohyeid commented Nov 8, 2017

I am facing the same problem because I am using import inside my worker.ts. I am importing a ts module that have the export keyword. I believe the file loader need to define that keyword somehow!

@garrettm
Copy link

I'm also having this problem -- is there a solution?

@mohyeid
Copy link

mohyeid commented Nov 18, 2017

I ended up having to write the classes that I import inside the workers file on top of the file. Not elegant, but it solved it at least.

@garrettm
Copy link

@mohyeid thanks, I might end up doing that. @mogadanez were you able to find a different fix for this?

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