[Pkg-javascript-devel] Bug#927254: Bug#927254: possible solution

Paolo Greppi paolo.greppi at libpf.com
Tue Jun 11 08:16:16 BST 2019


On 10/06/19 20:03, Paolo Greppi wrote:
> ...
> Tomorrow I'll test the generated file inside laminar. If that works this is an acceptable solution.
> The last bit is to move this config change to debian/rollup-umd.js so that it does not impact all builds..
> 
> Paolo
> 

I tested with the non-minified file generated using the patched build/config.js and this command:
NODE_PATH=debian/node_modules/ rollup -m -c debian/rollup-umd.js
but when opening the laminar dashboard I get a new error:

vue-router.min.js:1195 Uncaught TypeError: Cannot read property 'forEach' of undefined
     at compileRouteRegex (vue-router.min.js:1195)
     at addRouteRecord (vue-router.min.js:1112)
     at vue-router.min.js:1061
     at Array.forEach (<anonymous>)
     at createRouteMap (vue-router.min.js:1060)
     at createMatcher (vue-router.min.js:1274)
     at new VueRouter (vue-router.min.js:2374)
     at app.js:796

Not sure if this is due to some path-to-regexp API change.

Anyway that code is skipped for the minified version:
https://salsa.debian.org/js-team/vue-router.js/blob/master/src/create-route-map.js#L156

so I tested the file generated with:
NODE_PATH=debian/node_modules/ rollup -m -c debian/rollup-umd-min.js

and the JavaScript now works apart from some missing CSS and vue is in dev mode (see attached screenshot)

So I confirm that the way to go to fix the issue with libjs-vue-router minified UMD build is to enable rollup-plugin-node-resolve.
The proposed config change should be moved from build/config.js to debian/rollup-umd*.js so that it does not impact the other builds.

But the dev mode, minified UMD build would be affected by the exception above, generated in compileRouteRegex function.

Paolo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_20190611_090901.png
Type: image/png
Size: 71436 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20190611/1ba95d29/attachment.png>


More information about the Pkg-javascript-devel mailing list