Ionic-app-scripts: Parse JS SDK stopped working with script tag in app-scripts v0.0.31 and above.

Created on 18 Oct 2016  路  6Comments  路  Source: ionic-team/ionic-app-scripts

Short description of the problem:

Parse SDK stopped working when I updated app-script from v0.0.30.

At v0.0.30 the with the script tag (that is the last resort to include third party libraries) the library worked very well,

From v.0.0.31 until v0.0.36 I receive a lot of errors like:

"Cannot find namespace 'Parse'."

Environment

Windows 10
Node v6.9.0 LTS

Which @ionic/app-scripts version are you using?
v0.0.31, ~ v0.0.36

bug

Most helpful comment

Closing this issue because webpack build resolved my issue with parse SDK.

Sourcemaps is not working yet but it is being tracked in other issue. https://github.com/driftyco/ionic-app-scripts/issues/220

The ionic serve issue was resolved by adding manifest.json in 'src' folder as discussed here:

For everyone that need to use Parse sdk with ionic RC0/RC1 only need to follow the following steps;

npm install @ionic/app-scripts@beta ( or future release with webpack )
npm install parse --save
npm install @types/parse --save-dev

TS files:
import Parse from 'parse';

and use it normally.

Thanks

All 6 comments

Hello! Thanks for opening an issue with us! Would you mind installing our latest beta release of app-scripts with npm install @ionic/app-scripts@betaand giving that a try? With that release we use webpack by default which should work fine with Parse with no configuration.

Hello @jgw96

I'm testing this new release.
I undid all the special configurations that I had to do to get Parse working with rollup.

And there are good news:
npm run build seems to work.

But ionic serve freezes on "build dev finished"

[15:02:26]  ionic-app-scripts 0.0.37                                                                                                                            
[15:02:26]  watch started ...                                                                                                                                   
[15:02:26]  build dev started ...                                                                                                                               
[15:02:26]  clean started ...                                                                                                                                   
[15:02:26]  clean finished in 7 ms                                                                                                                              
[15:02:26]  copy started ...                                                                                                                                    
[15:02:26]  transpile started ...                                                                                                                               
[15:02:27]  lint started ...                                                                                                                                    
[15:02:34]  lint finished in 7.10 s                                                                                                                             
[15:02:35]  transpile finished in 9.17 s                                                                                                                        
[15:02:35]  webpack started ...                                                                                                                                 
[15:02:36]  copy finished in 10.57 s                                                                                                                            
[15:02:47]  webpack finished in 12.30 s                                                                                                                         
[15:02:47]  sass started ...                                                                                                                                    
[15:02:49]  sass finished in 2.03 s                                                                                                                             
[15:02:49]  build dev finished in 23.54 s   

The exact same case that was described in the ionic forum:
https://forum.ionicframework.com/t/help-us-test-webpack-support-in-ionic-2-app-scripts/67507/9

I'd forced the watch to try to test the new build.

Now my superclasses stopped working.
I have a lot of classes that use extends, and seems that ts isn't transpile them property.

At ionic serve I've got:

index.js:15 Uncaught TypeError: Cannot read property 'prototype' of undefined

And with ionic run android:

ReferenceError: __extends is not defined

@jgw96 @danbucholtz
Small update:

It's seems to be a problem with barrels.

I had to import my base classes explicity, and the problem changed...

Failed to load resource: the server responded with a status of 404 (Not Found) GET http://localhost:8100/build/main.css

I use barrels a lot, I will try to remove all barrels to see if it works.

Small update 2:

I removed all barrels that are base classes or injected classes.
Others barrels worked.

Ionic serve isn't working well and there are no sourcemaps.

Thank you.

Closing this issue because webpack build resolved my issue with parse SDK.

Sourcemaps is not working yet but it is being tracked in other issue. https://github.com/driftyco/ionic-app-scripts/issues/220

The ionic serve issue was resolved by adding manifest.json in 'src' folder as discussed here:

For everyone that need to use Parse sdk with ionic RC0/RC1 only need to follow the following steps;

npm install @ionic/app-scripts@beta ( or future release with webpack )
npm install parse --save
npm install @types/parse --save-dev

TS files:
import Parse from 'parse';

and use it normally.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ihadeed picture ihadeed  路  97Comments

squallliu picture squallliu  路  62Comments

chriswep picture chriswep  路  72Comments

Manduro picture Manduro  路  78Comments

mburger81 picture mburger81  路  54Comments