Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1025735

Bug#970550: replacing browserify with webpack or rollup - need help

From Pirate Praveen <praveen@onenetbeyond.org>
Newsgroups linux.debian.bugs.dist
Subject Bug#970550: replacing browserify with webpack or rollup - need help
Date 2020-09-20 11:50 +0200
Message-ID <AR48N-6ga-1@gated-at.bofh.it> (permalink)
References <AQpIl-7aP-3@gated-at.bofh.it> <AR3w6-63d-9@gated-at.bofh.it> <AR3FL-66u-3@gated-at.bofh.it> <AQo9z-69Z-1@gated-at.bofh.it> <AR3FL-66u-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Control: tags -1 help

On Sun, Sep 20, 2020 at 14:44, Pirate Praveen 
<praveen@onenetbeyond.org> wrote:
> The warning now changes to,
> 
> (!) Missing shims for Node.js built-ins
> Creating a browser bundle that depends on 'path', 'url' and 'os'. You 
> might need to include 
> https://www.npmjs.com/package/rollup-plugin-node-builtins
> (!) Unresolved dependencies
> https://rollupjs.org/guide/en#warning-treating-module-as-external-dependency
> path (imported by ../../../usr/share/nodejs/browserslist/index.js, 
> commonjs-external:path, 
> ../../../usr/share/nodejs/postcss/lib/input.js, 
> ../../../usr/share/nodejs/browserslist/node.js, 
> ../../../usr/share/nodejs/postcss/lib/map-generator.js, 
> ../../../usr/share/nodejs/postcss/lib/previous-map.js)

rollup-plugin-node-builtins is not packaged in debian. So I decided to 
try webpack (code pushed to a separate branch 'webpack'),

This has resulted in a situation where we need to handle Buffer 
correctyly.

with Buffer: true in webpack.config.js, the build fails with error

ERROR in /usr/share/nodejs/postcss/lib/map-generator.js
Module not found: Error: Can't resolve 
'./../../../../../<<PKGBUILDDIR>>/buffer' in 
'/usr/share/nodejs/postcss/lib'
 @ /usr/share/nodejs/postcss/lib/map-generator.js 1:0-89
 @ /usr/share/nodejs/postcss/lib/lazy-result.js
 @ /usr/share/nodejs/postcss/lib/processor.js
 @ /usr/share/nodejs/postcss/lib/postcss.js
 @ ./lib/autoprefixer.js

with Buffer: "mock" or Buffer: false, the build passes, but now rake 
assets:precompile in diaspora fails with the following error

root@diaspora-buster-main:/usr/share/diaspora# sudo -u diaspora -E -H 
bundle exec rake assets:precompile
rake aborted!
ExecJS::RuntimeError: /tmp/execjs20200920-897-qyh1s1js:87
    process.stdout.write('' + string);
                   ^

TypeError: Cannot read property 'write' of undefined
    at print (/tmp/execjs20200920-897-qyh1s1js:87:20)
    at /tmp/execjs20200920-897-qyh1s1js:101:5
    at /tmp/execjs20200920-897-qyh1s1js:1:40
    at Object.<anonymous> (/tmp/execjs20200920-897-qyh1s1js:1:58)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
/usr/share/diaspora/app/assets/config/manifest.js:9
(execjs):87
/usr/share/rubygems-integration/all/gems/autoprefixer-rails-8.6.5/lib/autoprefixer-rails/processor.rb:153:in 
`runtime'
/usr/share/rubygems-integration/all/gems/autoprefixer-rails-8.6.5/lib/autoprefixer-rails/processor.rb:37:in 
`process'
/usr/share/rubygems-integration/all/gems/autoprefixer-rails-8.6.5/lib/autoprefixer-rails/sprockets.rb:20:in 
`run'
/usr/share/rubygems-integration/all/gems/autoprefixer-rails-8.6.5/lib/autoprefixer-rails/sprockets.rb:14:in 
`call'
/usr/share/rubygems-integration/all/gems/rake-13.0.1/exe/rake:27:in 
`<top (required)>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
root@diaspora-buster-main:/usr/share/diaspora#

libraryTarget="window", libraryTrget="umd" was also tried without 
success.

Packaging rollup-plugin-node-builtins may be one option. Any ideas?

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#970550: diaspora installation fails with ExecJS::ProgramError: TypeError: Cannot read property 'list' of undefined Pirate Praveen <praveen@onenetbeyond.org> - 2020-09-18 15:00 +0200
  Bug#970550: this is a bug in ruby-autoprefixer-rails Pirate Praveen <praveen@onenetbeyond.org> - 2020-09-18 16:40 +0200
    Bug#970550: this is a bug in libjs-autoprefixer Pirate Praveen <praveen@onenetbeyond.org> - 2020-09-20 11:10 +0200
  Bug#970550: replacing browserify with webpack or rollup - need help Pirate Praveen <praveen@onenetbeyond.org> - 2020-09-20 11:50 +0200
    Bug#970550: [Pkg-javascript-devel] Bug#970550: replacing browserify with webpack or rollup - need help Nilesh Patra <npatra974@gmail.com> - 2020-09-20 12:30 +0200
  Bug#970550: [Pkg-javascript-devel] Bug#970550: Bug#970550: replacing browserify with webpack or rollup - need help Pirate Praveen <praveen@onenetbeyond.org> - 2020-09-24 13:50 +0200

csiph-web