-
-
Notifications
You must be signed in to change notification settings - Fork 826
Open
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
3.0.0
Current Behavior
I am trying to ion-js in Stencil Component. I can get the same code to work in a React workspace but due to module it dosent seem to work in Stencil
componentWillLoad() {
let ionData = `{ ccp_datatype_name:ResponsiblePerson, ccp_datatype_version:"1.0", definition:type::{ name: PriceSchema, major_version:1, minor_version:0, base:VariantBase, fields:[ { name:category, type:symbol, nullable:false, min_occurs:1, max_occurs:1 }, { name:address_identifier, type:string, nullable:false, min_occurs:1, max_occurs:1 } ] }, status:active, table_name:ccp_datatypes}`;
let value = ion.load(ionData);
console.log(value.fields())
}
This same code works in run kit / React but not in stencil
require("jsbi/package.json"); // jsbi is a peer dependency.
var ionJs = require("ion-js")
let ionData = `{ ccp_datatype_name:ResponsiblePerson, ccp_datatype_version:"1.0", definition:type::{ name: PriceSchema, major_version:1, minor_version:0, base:VariantBase, fields:[ { name:category, type:symbol, nullable:false, min_occurs:1, max_occurs:1 }, { name:address_identifier, type:string, nullable:false, min_occurs:1, max_occurs:1 } ] }, status:active, table_name:ccp_datatypes}`;
let value = ionJs.load(ionData);
console.log(value.fields());
Expected Behavior
It should be able to parse and use the lib
System Info
Brave / MacSteps to Reproduce
Just Put this code in any Stencil Starter Repo under ComponentDidLoad and you should see error in console.
TypeError: Cannot read properties of undefined (reading 'IonTypes')
at Blob.js:6:36
at createCommonjsModule (utils.ts:3:1)
at Lob.js:58:1 undefined
Code Reproduction URL
https://codesandbox.io/s/issue-in-stencil-and-ion-js-6uzg1w
Additional Information
No response
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil