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

uuid v4 cannot #1

Open
GlobeFishNG opened this issue Dec 23, 2022 · 0 comments
Open

uuid v4 cannot #1

GlobeFishNG opened this issue Dec 23, 2022 · 0 comments

Comments

@GlobeFishNG
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant