Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARToolkitNFT.js (dist lib) error while loading under node.js env #138

Open
kalwalt opened this issue Mar 11, 2022 · 2 comments
Open

ARToolkitNFT.js (dist lib) error while loading under node.js env #138

kalwalt opened this issue Mar 11, 2022 · 2 comments
Labels
bug Something isn't working nodejs

Comments

@kalwalt
Copy link
Member

kalwalt commented Mar 11, 2022

As said in issue #128 #128 (comment) we should build the dist lib with these instructions:

// in webpack.config.js
target: 'node',
 node: {
   process: false
 },
 plugins: [
   new webpack.DefinePlugin({
     'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
   })
 ],
@kalwalt kalwalt added bug Something isn't working nodejs labels Mar 11, 2022
@kalwalt
Copy link
Member Author

kalwalt commented Mar 12, 2022

// in webpack.config.js
target: 'node',
 node: {
   process: false
 },
 plugins: [
   new webpack.DefinePlugin({
     'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
   })
 ],

This was for webpack 4 but we are using webpack 5, there are some changes to apply, see this commit 4d97303
i tested the code. The dist lib can be imported with node but some difficulties with loading the camera file. Anyway the fact is the same dist lib can not loaded inside a browser. So you need to provide two versions of the dist lib.

@kalwalt
Copy link
Member Author

kalwalt commented Apr 1, 2022

I'm not sure to follow this path but if someone has experience in this subject and can spent a good words on this, i can hear other toughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nodejs
Projects
None yet
Development

No branches or pull requests

1 participant