#Nest build not producing dist/
33 messages · Page 1 of 1 (latest)
Do you have a custom swcrc?
yes:
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./"
"paths": {
"src/*": ["src/*"]
}
},
"minify": false
}
I got it from the docs, this works in development
So it builds correctly in dev but not in prod?
but nest build fails with:
Fallback bindings does not support filesystem access.
Failed to compile 268 files with swc.
this after install with npm install --production
I can run dev, but can build prod
What's your prod environment? Or the environment where you build for prod? This is an issue with the swc native binaries
well I'm deploying to heroku, however I just tried this locally which is where I got that error from the app appears to build and heroku but crash upon request
Okay. Hmm, I'd suggest checking with swc's repo(s) about issues on Heroku
This seems to be a bit of a long standing issue with possible fixes: https://github.com/swc-project/swc/issues/5616
actually I install @swr/core and @swr/cli and it build (these were in devDependencies so they weren't installed), but now the start script won't work
They should just be devDeps, they're only depended on for the build
well since the build happens in heroku I think at least for prod I'll need them there right?
Nope
Heroku has several phases ofd how it handles moving the code about
Generally it's something like:
Push to heroku's git
Heroku installs deps
Run build?
Prune deps
Set env
Run start
hmmm... I think I found something different, it looks like my dist folder use to include src/ but now everything is directly in dist/
Dist would include src if you imported from outside of src, at least with Typescript tht's what would happen
that doesn't appear to be the case anymore though
I this something I changed? somehow?
Does your src import from outside of src?
What does your directory structure look like?
you mean inside of dist just like the screenshot, I just deployed to heroku with updated paths and it seems to run now
I was meaning your project all together, but glad it's running nonetheless
now I wonder why dist/ ever included src/ to begin with
oh my project is just the vanilla structure src/resource-name/ folder structure
thanks for listen to me ramble, it really help me think about what I did and guided me through the troubleshoot
🦆
heh I need to get one of those rubber ducks dressed in mgs costumes