michaelawyu / cloudevents-generator Goto Github PK
View Code? Open in Web Editor NEWHelps produce, consume, and collaborate on CloudEvents easier.
Home Page: https://michaelawyu.github.io/cloudevents-generator/
License: Apache License 2.0
Helps produce, consume, and collaborate on CloudEvents easier.
Home Page: https://michaelawyu.github.io/cloudevents-generator/
License: Apache License 2.0
I used the example to generate node.js lib with http bind as below.
cloudevents-generator generate --input ce.yaml --output lib --language nodejs --binding HTTP
When I tried to use the lib, there was an error.
$ functions-framework --target=helloCloudEvents --signature-type=event --port=8081
Provided module can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v4' is not defined by "exports" in /home/littlefox/works/serverless/kogito/serverless-workflow-hello-world/openfunction/hello/node_modules/uuid/package.json
at new NodeError (internal/errors.js:322:7)
at throwExportsNotFound (internal/modules/esm/resolve.js:332:9)
at packageExportsResolve (internal/modules/esm/resolve.js:565:3)
at resolveExports (internal/modules/cjs/loader.js:450:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/home/littlefox/works/serverless/kogito/serverless-workflow-hello-world/openfunction/hello/lib/mypackage/Basic/Basic.js:1:16)
Could not load the function, shutting down.
error Command failed with exit code 1.
Then I updated the generated code from const uuidv4 = require('uuid/v4');
to const uuidv4 = require('uuid');
, the error was fixed.
My dev environment is here
$ node -v
v14.21.2
$ npm -v
6.14.17
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.