delightful-monkey-90700
07/09/2024, 7:57 PMpulumi up
fails on one of my stacks with the error:
error: Error: ENOENT: no such file or directory, stat '<stackname>'
at Object.statSync (node:fs:1690:3)
at resolveConfigPath (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:90:9)
at loadSyncDefault (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:60:12)
at tsConfigLoader (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:47:20)
at configLoader (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/config-loader.ts:66:22)
at Object.register (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/register.ts:80:25)
at Object.<anonymous> (/home/rkeene/devel/project/node_modules/tsconfig-paths/register.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions.<computed> [as .js] (/home/rkeene/devel/project/node_modules/ts-node/src/index.ts:1608:43)
It's not clear why it cares that there is no directory named stackname
(where the actual value is the name of the stack, not the literal word "stackname") suddenly. It appears to be trying to locate a "tsconfig" file, but there has never been (nor will be) anything named "stackname"little-cartoon-10569
07/09/2024, 9:21 PMdelightful-monkey-90700
07/09/2024, 10:25 PMdelightful-monkey-90700
07/09/2024, 10:25 PMlittle-cartoon-10569
07/09/2024, 10:36 PMdelightful-monkey-90700
07/09/2024, 11:05 PM@pulumi/pulumi/cmd/run/run
while calling tsn.register()
here: https://github.com/pulumi/pulumi/blob/74e8928cff4f605a157d0991191bbf0b9b25967d/sdk/nodejs/cmd/run/run.ts#L262little-cartoon-10569
07/09/2024, 11:28 PMimport
or require
line. But how do find which one? I have no idea 😞delightful-monkey-90700
07/09/2024, 11:28 PMdelightful-monkey-90700
07/09/2024, 11:29 PMtsn.register()
never returns, since it throws that errordelightful-monkey-90700
07/09/2024, 11:29 PMlittle-cartoon-10569
07/09/2024, 11:29 PMlittle-cartoon-10569
07/09/2024, 11:29 PMdelightful-monkey-90700
07/09/2024, 11:29 PMdelightful-monkey-90700
07/09/2024, 11:30 PMtsn.register()
little-cartoon-10569
07/09/2024, 11:30 PMdelightful-monkey-90700
07/09/2024, 11:30 PMlittle-cartoon-10569
07/09/2024, 11:31 PMdelightful-monkey-90700
07/09/2024, 11:32 PMtsconfig.json
file (which isn't code)delightful-monkey-90700
07/09/2024, 11:32 PMdelightful-monkey-90700
07/09/2024, 11:33 PMlittle-cartoon-10569
07/09/2024, 11:33 PMruntime:
name: nodejs
options:
nodeargs: "--loader ts-node/esm --no-warnings --experimental-specifier-resolution=node"
delightful-monkey-90700
07/09/2024, 11:34 PMtsconfig.json
delightful-monkey-90700
07/09/2024, 11:34 PMlittle-cartoon-10569
07/09/2024, 11:34 PMdelightful-monkey-90700
07/09/2024, 11:35 PMlittle-cartoon-10569
07/09/2024, 11:35 PMdelightful-monkey-90700
07/09/2024, 11:36 PM~/.pulumi
little-cartoon-10569
07/09/2024, 11:37 PMlittle-cartoon-10569
07/09/2024, 11:37 PMdelightful-monkey-90700
07/09/2024, 11:37 PMtsconfig.js
caused it to do something different, but that different thing isn't workingdelightful-monkey-90700
07/09/2024, 11:38 PMdelightful-monkey-90700
07/09/2024, 11:38 PMPulumi.yaml
has:
name: project-cloud-deploy
description: Cloud Deployment
runtime: nodejs
main: deployment
little-cartoon-10569
07/09/2024, 11:38 PMdelightful-monkey-90700
07/09/2024, 11:38 PMdeployment/
I have tsconfig.json
and index.ts
delightful-monkey-90700
07/09/2024, 11:39 PMlittle-cartoon-10569
07/09/2024, 11:39 PMdelightful-monkey-90700
07/09/2024, 11:39 PMpulumi up
runs my main program -- (i.e., not deployment/index.ts
, but src/index.ts
from the program root)delightful-monkey-90700
07/09/2024, 11:39 PMdelightful-monkey-90700
07/09/2024, 11:40 PMmain
within Pulumi.yaml
little-cartoon-10569
07/09/2024, 11:40 PMmain
property in your Pulumi.yaml? I don't see it in the docs,little-cartoon-10569
07/09/2024, 11:40 PMdelightful-monkey-90700
07/09/2024, 11:41 PMlittle-cartoon-10569
07/09/2024, 11:41 PMdelightful-monkey-90700
07/09/2024, 11:42 PMlittle-cartoon-10569
07/09/2024, 11:42 PMdelightful-monkey-90700
07/09/2024, 11:43 PMmain
as well ? (since then it would refer to a directory that doesn't exist, since I don't have deployment/deployment
)little-cartoon-10569
07/09/2024, 11:43 PMFor Node.js projects, main can point to a .ts or .js file and behaves similarly to setting the main attribute in package.json. When the main property is set in Pulumi.yaml, it may be omitted from package.json (and vice-versa). When it exists in both Pulumi.yaml and package.json, the value in Pulumi.yaml takes precedence.But you have a directory, not a .ts/.js file. Maybe change to deployment/index.ts?
delightful-monkey-90700
07/09/2024, 11:44 PM../src/index.ts
little-cartoon-10569
07/09/2024, 11:44 PMdelightful-monkey-90700
07/09/2024, 11:45 PMdelightful-monkey-90700
07/09/2024, 11:49 PM.../project/deployment> ls -l
total 20
-rw-r--r-- 1 rkeene rkeene 13076 Jul 9 18:36 index.ts
-rw-r--r-- 1 rkeene rkeene 70 Jul 9 18:45 tsconfig.json
.../project/deployment> cat tsconfig.json
{
"extends": "../tsconfig.json",
"include": [ "index.ts" ],
}
.../project/deployment> cat ../Pulumi.yaml
name: project-cloud-deploy
description: Cloud Deployment
runtime: nodejs
main: ./deployment/index.ts
.../project/deployment>
.../project/deployment> cd ..
.../project> pulumi up
Previewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack project-cloud-deploy-dev 1 error; 111 messages
Diagnostics:
pulumi:pulumi:Stack (jester-cloud-deploy-dev):
error: Error: ENOENT: no such file or directory, stat 'project-cloud-deploy'
at Object.statSync (node:fs:1690:3)
at resolveConfigPath (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:91:10)
at loadSyncDefault (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:61:7)
at tsConfigLoader (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/tsconfig-loader.ts:48:2)
at configLoader (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/config-loader.ts:66:22)
at Object.register (/home/rkeene/devel/project/node_modules/tsconfig-paths/src/register.ts:80:25)
at Object.<anonymous> (/home/rkeene/devel/project/node_modules/tsconfig-paths/register.js:1:15)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Object.require.extensions.<computed> [as .js] (/home/rkeene/devel/project/node_modules/ts-node/src/index.ts:1612:11)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Function.Module._load (node:internal/modules/cjs/loader:960:12)
at internalRequire (node:internal/modules/cjs/loader:174:19)
at Function.Module._preloadModules (node:internal/modules/cjs/loader:1433:5)
at Object.register (/home/rkeene/devel/project/node_modules/ts-node/src/index.ts:614:18)
at Object.<anonymous> (/home/rkeene/devel/project/node_modules/@pulumi/cmd/run/run.ts:284:9)
at Generator.next (<anonymous>)
at /home/rkeene/devel/project/node_modules/@pulumi/pulumi/cmd/run/run.js:21:71
at new Promise (<anonymous>)
at __awaiter (/home/rkeene/devel/project/node_modules/@pulumi/pulumi/cmd/run/run.js:17:12)
at Object.run (/home/rkeene/devel/project/node_modules/@pulumi/pulumi/cmd/run/run.js:222:12)
at /home/rkeene/devel/project/node_modules/@pulumi/cmd/run/index.ts:163:57
at processTicksAndRejections (node:internal/process/task_queues:95:5)
delightful-monkey-90700
07/09/2024, 11:50 PMproject-cloud-deploy
appears is within Pulumi.yaml
(in the project root) -- that's literally the only place that string existsdelightful-monkey-90700
07/10/2024, 12:05 AMdeployment/project-cloud-deploy
resolved itlittle-cartoon-10569
07/10/2024, 12:06 AMlittle-cartoon-10569
07/10/2024, 12:07 AMmain
property is at fault? If you put a Pulumi.yaml without that in the same dir as index.ts, do you avoid the error? This definitely is a bug.delightful-monkey-90700
07/10/2024, 12:09 AMmain
and move Pulumi*yaml
into deployment
delightful-monkey-90700
07/10/2024, 12:09 AMname
in the Pulumi.yaml
which it shouldn'tdelightful-monkey-90700
07/10/2024, 3:51 AM<root>/tsconfig.json
:
{
...
"ts-node": {
"require": ["tsconfig-paths/register"]
}
}
To resolve it, I added an override to the `deployment/tsconfig.json`:
{
"extends": "../tsconfig.json",
"include": [
"index.ts"
],
"ts-node": {
"require": []
}
}
little-cartoon-10569
07/10/2024, 9:16 PMdelightful-monkey-90700
07/10/2024, 10:37 PMmain
to specify ./deployment/index.ts
instead of just deployment