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
I'm trying to add a third-party dependency @apidevtools/json-schema-ref-parser (https://github.com/APIDevTools/json-schema-ref-parser) to traverse a JSON schema for autocompletion in a code editor. The package uses require('http') and require('https'). In portal I get errors of missing dependency:
[
"Missing dependency 'liferay!search-experiences-web$http' of '@liferay!search-experiences-web$apidevtools/[email protected]/lib/resolvers/http'",
"Missing dependency 'liferay!search-experiences-web$https' of '@liferay!search-experiences-web$apidevtools/[email protected]/lib/resolvers/http'",
"Missing version constraints for 'liferay!search-experiences-web$http' in package.json of '@liferay!search-experiences-web$apidevtools/[email protected]' (required from its 'lib/resolvers/http' module)",
"Missing version constraints for 'liferay!search-experiences-web$https' in package.json of '@liferay!search-experiences-web$apidevtools/[email protected]' (required from its 'lib/resolvers/http' module)"
]
A github issue (APIDevTools/json-schema-ref-parser#254 (comment)) about these missing packages resolves this issue by adding polyfills stream-http and https-browserify using the webpack.config.js configuration:
Hey @thektan! Thanks for opening this. How urgent is this need? We can fit it in at some point, but just want to get an idea of how soon we need to work on it.
Hi @bryceosterhaus! I was able to write a basic $ref resolver which works for simple paths in the same file. It works for our use case at the moment so this is not as urgently needed anymore.
It'd still be helpful to eventually use this library to resolve references to other files so we could organize and reduce duplicated schema, but I'd say this not as important anymore.
@thektan good to know! Let us know if/when this becomes more urgent. We will keep this in our backlog and hope to address it soon, however we are working on some new build and bundle processes and we may not need node shims in the future, so its possible this may resolve itself with new techniques.
Issue type (mark with
x
)Description
I previously created a thread in #t-dxp-frontend-infra here: https://liferay.slack.com/archives/CNBG06JS3/p1648595258944989
I'm trying to add a third-party dependency
@apidevtools/json-schema-ref-parser
(https://github.com/APIDevTools/json-schema-ref-parser) to traverse a JSON schema for autocompletion in a code editor. The package usesrequire('http')
andrequire('https')
. In portal I get errors of missing dependency:A github issue (APIDevTools/json-schema-ref-parser#254 (comment)) about these missing packages resolves this issue by adding polyfills
stream-http
andhttps-browserify
using thewebpack.config.js
configuration:Desired behavior:
Can something similar to the webpack.config.js be done (or supported if it doesn't exist) to resolve the missing dependencies?
Current behavior:
Unable to resolve the missing node
http
andhttps
dependencies to use the@apidevtools/json-schema-ref-parser
package.The text was updated successfully, but these errors were encountered: