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
The line const event = new CloudEvent(ce); is causing the following error
./node_modules/cloudevents/dist/transport/http/index.js:11:31-46 - Error: Module not found: Error: Can't resolve 'http' in '\node_modules\cloudevents\dist\transport\http'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
./node_modules/cloudevents/dist/transport/http/index.js:12:32-48 - Error: Module not found: Error: Can't resolve 'https' in '\node_modules\cloudevents\dist\transport\http'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
Could you please help me in solving the above error.
@shaheer-k hi - you need to configure webpack to handle the fact that we do not ship polyfills for the https and http modules. The most straightforward way to do this is with the suggestion provided by the error message. Add this to your webpack config.
@shaheer-k I am going to close this, assuming you've had some success. If you have not been able to get this to work, please re-open this issue or create a new one. Thanks.
Activity
lholmquist commentedon May 27, 2022
@shaheer-k there aren't any packages that i know of that wrap this sdk in an angular component(or whatever it is called in Angular land).
But this is just a regular javascript library that should be able to be integrated into any JS framework
shaheer-k commentedon May 30, 2022
@lholmquist
thank you for the response.
I installed cloudevent sdk in Angular
12.0.0application.npm install cloudeventsInstallation completed successfully.
I tried the following code in my .ts file
The line
const event = new CloudEvent(ce);is causing the following errorCould you please help me in solving the above error.
lance commentedon May 31, 2022
@shaheer-k hi - you need to configure webpack to handle the fact that we do not ship polyfills for the
httpsandhttpmodules. The most straightforward way to do this is with the suggestion provided by the error message. Add this to your webpack config.github-actions commentedon Jul 1, 2022
This issue is stale because it has been open 30 days with no activity.
lance commentedon Jul 5, 2022
@shaheer-k I am going to close this, assuming you've had some success. If you have not been able to get this to work, please re-open this issue or create a new one. Thanks.