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

Importing ion-js in a JS package fails #743

Open
rahulrsingh09 opened this issue Feb 22, 2023 · 0 comments
Open

Importing ion-js in a JS package fails #743

rahulrsingh09 opened this issue Feb 22, 2023 · 0 comments
Labels

Comments

@rahulrsingh09
Copy link

This issue is concerning [ Ion JS ] when used inside StencilJS. I see we have mentioned

A distribution using browserify and babelify creates a browser friendly polyfilled distribution targeting ES5: at dist/browser/js/ion-bundle.js.

But when installing we donot see this in node modules what is missing here to support stencil es2017

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())
  }

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   

Steps to reproduce

https://codesandbox.io/s/issue-in-stencil-and-ion-js-6uzg1w

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

1 participant