breezy-butcher-78604
04/07/2020, 7:59 AMsrc/
rather than in the top level dir. my function definition looks like this:
const myFunction = new aws.serverless.Function("my-func", {
callback: (a, b, c) => { console.log(a,b,c); }
});
but when i run pulumi up
i get the following error:
Error reading file '<path-to-project>/src/package.json' when computing package dependencies. Error: ENOENT: no such file or directory, open '<path-to-project>/src/package.json'
is there a way I can get pulumi to look up a directory? or is there a way i can define a function inline without it having to check the package.json?stocky-island-3676
04/07/2020, 8:01 AMpulumi up
in src/
working-directory?breezy-butcher-78604
04/07/2020, 8:02 AMPulumi.yaml
file is not in that directorysrc/
index.ts
config/
Pulumi.dev.yaml
Pulumi.prod.yaml
Pulumi.yaml
package.json
package-lock.json
stocky-island-3676
04/07/2020, 8:04 AM"main": "src/index"
in the package.json
? No tsconfig.json
?breezy-butcher-78604
04/07/2020, 8:09 AMmain
set in package.json, and I do have a tsconfig.json
file but chose to omit it from the above for simplicitystocky-island-3676
04/07/2020, 8:11 AMpulumi-aws
.gentle-diamond-70147
04/07/2020, 5:28 PMPulumi.yaml
in a similar manner to package.json:
main: src/
breezy-butcher-78604
04/08/2020, 1:39 AMPulumi.yaml
file, the problem isn’t that pulumi cant find the index.ts, its that when it goes to create the myFunc
resource, it needs to serialise the code in callback
. I assume part of that process involves reading a package.json
file to figure out what dependencies to package with it.package.json
file in src
(since there are no dependencies) it seems to fail.gentle-diamond-70147
04/08/2020, 2:32 AMPulumi.yaml
would help.
Can you open an isssue at https://github.com/pulumi/pulumi-aws with code to reproduce it?breezy-butcher-78604
04/08/2020, 2:33 AMfaint-table-42725
04/08/2020, 3:54 AMbreezy-butcher-78604
04/08/2020, 4:09 AM