#Nest build not producing dist/

33 messages · Page 1 of 1 (latest)

ruby scaffold
#

I recently updated to nest v10 and everything worked but after deploying I noticed the app wasn't starting tried to reproduce locally and noticed that npm run build or nest build does not produce a dist/ folder anymore did I mess something up in .swcrc?

left crest
#

Do you have a custom swcrc?

ruby scaffold
#

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

left crest
#

So it builds correctly in dev but not in prod?

ruby scaffold
#

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

left crest
#

What's your prod environment? Or the environment where you build for prod? This is an issue with the swc native binaries

ruby scaffold
#

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

left crest
ruby scaffold
#

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

left crest
ruby scaffold
#

well since the build happens in heroku I think at least for prod I'll need them there right?

left crest
#

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

ruby scaffold
#

hmmm... I think I found something different, it looks like my dist folder use to include src/ but now everything is directly in dist/

left crest
ruby scaffold
#

that doesn't appear to be the case anymore though

#

I this something I changed? somehow?

left crest
#

Does your src import from outside of src?

ruby scaffold
#

no I don't think so

#

rg '\.\./' src comes back blank

left crest
#

What does your directory structure look like?

ruby scaffold
#

you mean inside of dist just like the screenshot, I just deployed to heroku with updated paths and it seems to run now

left crest
#

I was meaning your project all together, but glad it's running nonetheless

ruby scaffold
#

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

left crest
#

🦆

ruby scaffold
#

heh I need to get one of those rubber ducks dressed in mgs costumes