express-vue / vue-pronto

Rendering Engine for turning Vue files into Javascript Objects
Apache License 2.0
20 stars 12 forks source link

TypeError: cachedBundle.data is not a function #101

Closed TheNaubit closed 5 years ago

TheNaubit commented 5 years ago
### Description of Issue TypeError in /lib/renderer/renderer.js. I am working on ExpressJS, using VueJS. If I am in a page of my site (it happens in all of them), if I refresh the page once, everything works. If I refresh it again, then I got a TypeError in renderer.js. ### Stack Trace / Console Log TypeError: cachedBundle.data is not a function at MakeVueClass.Promise (.....\myProject\node_modules\vue-pronto\lib\renderer\renderer.js:415:67) at new Promise () at Renderer.MakeVueClass (.....\myProject\node_modules\vue-pronto\lib\renderer\renderer.js:412:16) at FindFile.then.filePath (.....\myProject\node_modules\vue-pronto\lib\renderer\renderer.js:561:26) at ### Additional Comments I am sorry for not being really explicit explaining my error, but I am not really sure why it is happening. But if you need any extra info, let me know and I will post it. Also, meanwhile I fixed it replacing line 415 in the renderer.js file with these lines: `let cachedBundleError = false;` `try{` `let tmp = cachedBundle.data();` ` }catch(e){` `console.warn("There was a cachedBundle.data() error...");` `cachedBundle = true;` `}` `if (cachedBundle===false && cachedBundle) {` But obviously it is just a workaround meanwhile a fix is found. Thanks in advance!