Skip to content

How can I import a native C++ extension #14220

Answered by msujew
ngfelixl asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ngfelixl,

Thanks for the logs/context on this! Looking at this part:

@ ./node_modules/theia-ide-myextension-ext/lib/browser/myextension-contribution.js 28:31-72
@ ./node_modules/theia-ide-myextension-ext/lib/browser/myextension-frontend-module.js 13:38-78

It looks like you're attempting to load your native node package in the browser bundle. This is also indicated by the webpack error (we only generate a loader for .node files for the backend).

You need to bind the backend contribution in a dedicated backend-module.ts file that is entered as a backend module in your package.json. See for example:

"backend": "lib/node/i…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ngfelixl
Comment options

@msujew
Comment options

@ngfelixl
Comment options

Answer selected by ngfelixl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants