guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 173 forks source link

Uncaught ReferenceError: require is not defined #106

Open bwwilliam opened 7 years ago

bwwilliam commented 7 years ago

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 commented 7 years ago

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

ebrehault commented 7 years ago

I only use Angular CLI, and AOT goes well. So that's probably liked to your webpack config.