You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of this could be that I'm pretty new to these various module-generating tools that sprang up over the last two or three years. What I'm trying to do is roll up ProtoBuf and all of its dependencies along with my library using the rollup-plugin-commonjs and rollup-plugin-node-resolve plugins. The reason why I'm doing this is because there seems to be no way to use things like SystemJS or WebPack to deploy an app with my libraries, purely because ProtoBuf's requires of bytebuffer and a few other things. So I figured I would bundle everything into my library (ES2015) and move on. The reason I'm posting this issue here and not ProtoBuf is that when bundling it all up, the error I get is that 'memcpy' could not be resolved for bytebuffer-node.js.
The error I'm getting is:
Treating 'buffer' as external dependency
Could not resolve 'memcpy' from /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/bytebuffer/dist/bytebuffer-node.js
Error: Could not resolve 'memcpy' from /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/bytebuffer/dist/bytebuffer-node.js
at Error (native)
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:78:21
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:46:14
at process (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:173:43)
at ondir (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:188:17)
at load (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:69:43)
at onex (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:92:31)
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:123:15)
I got around this error by inspecting this line in bytebuffer-node.js
“ memcpy = null; try { memcpy = require("memcpy"); } catch (e) {}”
Looks like memcpy is an optional dep, but rollup might be harvesting all the require statements statically.
When I remove the try statement, the error disappears -- I still have other problems from getting aot + rollup + protobufjs to work ;), but at least this particular error has a workaround.
EDIT: This error also disappeared once I added rollup-plugin-node-globals and rollup-plugin-node-builtins to my rollup plugin, following this: rollup/rollup#1051 (comment)
Again, got a different error, but I think it's a rollup issue instead of bytebuffer.
Part of this could be that I'm pretty new to these various module-generating tools that sprang up over the last two or three years. What I'm trying to do is roll up ProtoBuf and all of its dependencies along with my library using the rollup-plugin-commonjs and rollup-plugin-node-resolve plugins. The reason why I'm doing this is because there seems to be no way to use things like SystemJS or WebPack to deploy an app with my libraries, purely because ProtoBuf's requires of bytebuffer and a few other things. So I figured I would bundle everything into my library (ES2015) and move on. The reason I'm posting this issue here and not ProtoBuf is that when bundling it all up, the error I get is that 'memcpy' could not be resolved for bytebuffer-node.js.
The error I'm getting is:
Treating 'buffer' as external dependency
Could not resolve 'memcpy' from /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/bytebuffer/dist/bytebuffer-node.js
Error: Could not resolve 'memcpy' from /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/bytebuffer/dist/bytebuffer-node.js
at Error (native)
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js:78:21
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:46:14
at process (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:173:43)
at ondir (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:188:17)
at load (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:69:43)
at onex (/var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:92:31)
at /var/redhawk/sdr/rest-python/apps/angular-redhawk/node_modules/resolve/lib/async.js:22:47
at FSReqWrap.oncomplete (fs.js:123:15)
The configuration I'm using is:
The text was updated successfully, but these errors were encountered: