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: require is not defined #186

Open
bwwilliam opened this issue Jun 18, 2017 · 3 comments
Open

Uncaught ReferenceError: require is not defined #186

bwwilliam opened this issue Jun 18, 2017 · 3 comments
Labels

Comments

@bwwilliam
Copy link

I am using the angular seed project as the base AngularSeed project.
I then use angular2 schema form to produce the dynamic forms.
And the dynamic form project has dependency on z-schema.
After doing the treeshaking, aot build (build.prod.rollup.aot), it shows the following error in the developer tools window.
Can someone please provide some help on this? The main problem is due to the rollup. If I simply do build.prod.aot, there is no issues.
image

@bwwilliam
Copy link
Author

If I change the reference from let ZSchema = require('z-schema') to import * as ZSchema from 'z-schema/dist/ZSchema-browser'
This is what I got
image

@zaggino
Copy link
Owner

zaggino commented Jun 18, 2017

hi, ZSchema-browser is already browserified file, maybe try just using import * as ZSchema from 'z-schema' when using roll-up ?

@bwwilliam
Copy link
Author

Hi @zaggino , thanks for your response. I tried it and unfortunately it did not work. https://github.com/bwwilliam/poc/blob/master/src/client/app/shared/schema-form/schemavalidatorfactory.ts
Here is the repo if you do not mind to take a look Source Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants