Message Boards

Liferay NPM Bundler Problem with Third party libary

Philipp Wachsmuth, modified 3 Years ago.

Liferay NPM Bundler Problem with Third party libary

New Member Post: 1 Join Date: 5/27/20 Recent Posts
Hello Everyone,
As you can already read in my title I have a Problem with the Bundler.
I used the Liferay-js generator for creating a simple Javascript project. The only libary I want to add is called formiojs.
As far as I can tell the problem is that the bundler does not find the node modules lay in @Types.

This is the error I get if I try to load it as a portlet on the portal:

Error: "The following problems where detected while resolving modules: · Missing dependency ':ERROR:Missing version constraints for formionpm$stream in package.json of formionpm$node-fetch@2.6.0' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency ':ERROR:Missing version constraints for formionpm$http in package.json of formionpm$node-fetch@2.6.0' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency ':ERRORpackage formionpm$url which is a dependency of formionpm$node-fetch@2.6.0 is not deployed in the server' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency ':ERROR:Missing version constraints for formionpm$https in package.json of formionpm$node-fetch@2.6.0' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency ':ERROR:Missing version constraints for formionpm$zlib in package.json of formionpm$node-fetch@2.6.0' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency ':ERROR:Missing version constraints for formionpm$encoding in package.json of formionpm$node-fetch@2.6.0' of 'formionpm$node-fetch@2.6.0/lib/index' · Missing dependency 'formionpm$dragula@3.7.2/dist/classes' of 'formionpm$dragula@3.7.2/dist/dragula' · Missing dependency 'formionpm$dragula@3.7.2/dist/debounce' of 'formionpm$dragula@3.7.2/dist/dragula' · Missing dependency 'formionpm$dragula@3.7.2/dist/eventmap' of 'formionpm$dragula@3.7.2/dist/dragula'" 

If I start the test server everythings works. I tried to add Typescript compiler as well but had no luck with it.

Here is my package.json:
{    "name""formionpm",    "version""1.0.0",    "description""Formionpm",    "devDependencies": {        "babel-cli""6.26.0",        "babel-loader""7.1.5",        "babel-preset-env""1.7.0",        "babel-preset-liferay-standard""^2.18.5",        "copy-webpack-plugin""4.6.0",        "liferay-npm-build-support""^2.18.5",        "liferay-npm-bundler""^2.18.5",        "liferay-npm-bundler-loader-babel-loader""^2.18.5",        "liferay-npm-bundler-plugin-exclude-imports""^2.18.5",        "liferay-npm-bundler-plugin-inject-imports-dependencies""^2.18.5",        "liferay-npm-bundler-plugin-inject-peer-dependencies""^2.18.5",        "liferay-npm-bundler-plugin-replace-browser-modules""^2.18.5",        "liferay-npm-imports-checker""^2.18.5",        "webpack""4.29.6",        "webpack-cli""3.3.0",        "webpack-dev-server""3.2.1"    },    "dependencies": {        "formiojs""^4.9.26"    },    "scripts": {        "build"" liferay-npm-bundler",        "copy-assets""lnbs-copy-assets",        "deploy""npm run build && lnbs-deploy",        "start""lnbs-start"    },    "portlet": {        "com.liferay.portlet.display-category""category.sample",        "com.liferay.portlet.header-portlet-css""/css/styles.css",        "com.liferay.portlet.instanceable"true,        "javax.portlet.name""formionpm",        "javax.portlet.security-role-ref""power-user,user",        "javax.portlet.display-name""Formionpm"    },    "main""index.js"}

Thank you all in advance and tell me if I can add additional information to solve the problem.