Railway projects suddenly failing with new "Cannot find type definition file for 'mime'" Error

AnonymousTRIAL

a year ago

Seems that something changed in the Railway infra because even 'redeploying' previously working projects, I'm getting this new error during build. Any idea why redeploys suddenly error on mime types?

``WARN config production Use--omit=dev` instead.

12 0.802

12 0.802 > medusa-starter-default@0.0.1 clean

12 0.802 > cross-env ./node_modules/.bin/rimraf dist

12 0.802

12 1.738 production environment using .env.production

12 35.94 error TS2688: Cannot find type definition file for 'mime'.

12 35.94 The file is in the program because:

12 35.94 Entry point for implicit type library 'mime'

12 ERROR: process "/bin/bash -ol pipefail -c cross-env npm run clean && cross-env medusa-admin build && tsc -p tsconfig.server.json" did not complete successfully: exit code: 2

[stage-0 8/10] RUN --mount=type=cache,id=s/fb3a601a-4fe9-4358-8ffd-12d303256e6e-nodemodules/cache,target=/app/nodemodules/.cache cross-env npm run clean && cross-env medusa-admin build && tsc -p tsconfig.server.json:
WARN config production Use --omit=dev instead.
0.802
0.802 > medusa-starter-default@0.0.1 clean
0.802 > cross-env ./node_modules/.bin/rimraf dist
0.802
1.738 production environment using .env.production
35.94 error TS2688: Cannot find type definition file for 'mime'.

35.94 The file is in the program because:

35.94 Entry point for implicit type library 'mime'

Dockerfile:24

22 | # build phase
23 | COPY . /app/.
24 | >>> RUN --mount=type=cache,id=s/fb3a601a-4fe9-4358-8ffd-12d303256e6e-nodemodules/cache,target=/app/nodemodules/.cache cross-env npm run clean && cross-env medusa-admin build && tsc -p tsconfig.server.json
25 |
26 |

ERROR: failed to solve: process "/bin/bash -ol pipefail -c cross-env npm run clean && cross-env medusa-admin build && tsc -p tsconfig.server.json" did not complete successfully: exit code: 2

Error: Docker build failed
```

2158ac66-80be-42ae-b4e4-d6bbbe244d21

Solved

0 Replies

AnonymousTRIAL

a year ago

To be clear, this suddenly started happening on multiple of my projects, that have had no changes, and deployed properly as recently as yesterday. Simply clicking 'redeploy' is enough to get the error to happen. So I've changed nothing and this new error is popping up. Very confused.


AnonymousTRIAL

a year ago

Railway projects suddenly failing with new "Cannot find type definition file for 'mime'" Error


a year ago

are you commiting your node_modules folder to github?


AnonymousTRIAL

a year ago

Nope!


AnonymousTRIAL

a year ago

I'm guessing something happened with Railway's nixpacks version, that has resulted in a brand new error on previously working code.


AnonymousTRIAL

a year ago

And as a result multiple projects that worked in a previous infra are now all crashing down. Shame.


a year ago

have you tried looking for solutions to this error? it wouldnt be isolated to railway


AnonymousTRIAL

a year ago

I'm even trying to 'redeploy' instances that were previously working and they also crash with this new error.


AnonymousTRIAL

a year ago

Including ones from several months ago.


a year ago

redeploy will redeploy, you might want a rollback instead


AnonymousTRIAL

a year ago

Yes, rollback will work, but that doesn't solve forwards.


AnonymousTRIAL

a year ago

I was just confirming that it's railway infra related.


a year ago

while i agree with you when you say that a nixpacks version bump introduced something different, this would not be an error that you could only get on railway


a year ago

saying that its railway infra related is not a correct sentence


AnonymousTRIAL

a year ago

I'm not deeply familiar with nixpacks, but basically multiple versions, multiple branches, multiple databases, ALL now fail on a redeploy or new deploy. Why would old (previously working) projects all suddenly fail in the same way.


AnonymousTRIAL

a year ago

Perhaps it's more correct to say the way railway deploys nixpacks is the issue? I may be wrong to even be looking at nixpacks, hence asking for help.


a year ago

databases dont use nixpacks, lets keep the scope of this to your service please


AnonymousTRIAL

a year ago

I meant applications pointing at different databases.


a year ago

have you tried looking for solutions to this error?


AnonymousTRIAL

a year ago

Just trying to get across that it's a sudden issue across a whole bunch of different applications with different setups, applications versions etc, which to me points to infra (railway, nixpacks, something else, not sure), but I have no idea which part of the infra to look at.


AnonymousTRIAL

a year ago

The 'error' is in a library my program made no change or has no specific reference to. And yes I've searched for solutions to it, but have found nothing useful.


a year ago

what is the nixpacks version of the last working deployment?


AnonymousTRIAL

a year ago

I'm not sure how to find that, or even control it. As I'm only using nixpacks as it was recommended for railway. I'm not even sure I understand the concept of a 'nixpacks version'.


AnonymousTRIAL

a year ago

Is there a way to tell the nixpacks version on a running deployment?


a year ago

look at the build table in the build logs


AnonymousTRIAL

a year ago

The most recent successful build was over 30 days ago, so I cannot see build logs. Any other way to see it? And on Railway is there even a way to force an older version of nixpacks, or is that inaccessible?

For reference, my nixpacks.toml looks like this:
```[phases.setup]
nixPkgs = ['nodejs', 'yarn', 'postgresql_16']

[phases.install]
cmds=['yarn install']```

Perhaps the nodejs version got bumped too far and has created this Typescript error in my projects? If so, I could perhaps lock the nodejs version (if that's even possible).


a year ago

respectfully, with a nixpacks.toml like that im suprised it has ever worked


a year ago

do you use yarn or npm locally?


AnonymousTRIAL

a year ago

Heh, beginning to realise this…


AnonymousTRIAL

a year ago

Yarn locally…


a year ago

do you have a yarn lock file?


AnonymousTRIAL

a year ago

Yes.


a year ago

do you have an npm lock file?


AnonymousTRIAL

a year ago

No, since I use yarn, I removed that and don't commit it either.


AnonymousTRIAL

a year ago

So I'm guessing I need to have a more 'locked down' nixpacks file?


a year ago

do you use yarn v1?

is your yarn lock file in sync with your package.json?


AnonymousTRIAL

a year ago

Yeah, I keep yarn lock in sync with package.json with yarn install, and committing it all together.


a year ago

nope, the opposite actually


a year ago

why do you need postgresql_16 ?


a year ago

or.. do you need it?


AnonymousTRIAL

a year ago

Because I use postgresql_16 in a script in my application that backs up my database to S3.


AnonymousTRIAL

a year ago

Since the DB on Railway are now postgres16, I needed that running on the server.


a year ago

indeed


a year ago

replace your nixpacks.toml with this

[phases.setup]
  nixPkgs = ['...', 'postgresql_16']

Status changed to Solved railway[bot] • about 1 year ago


AnonymousTRIAL

a year ago

Note that I originally got that nixpacks recommended format from here (https://docs.medusajs.com/deployments/server/deploying-on-railway), my project is a Medusa app.


a year ago

i know


AnonymousTRIAL

a year ago

Ok, I will try that now.


a year ago

but i dont know why they would add that


AnonymousTRIAL

a year ago

Heh, fair enough. For interest, does that mean Railway will pick what to install? (nixpacks dummy, remember)..


a year ago

nixpacks will detect this is a node app that uses yarn and install and run the applicable stuff


AnonymousTRIAL

a year ago

Ok, so do I also remove this from my nixpacks.toml?
[phases.install] cmds=['yarn install']


a year ago

yes


AnonymousTRIAL

a year ago

Thank you, rebuilding and the nixpacks header shows this now:

╔══════════════════════════════ Nixpacks v1.21.2 ══════════════════════════════╗ ā•‘ setup │ nodejs_18, yarn-1_x, postgresql_16 ā•‘ ║──────────────────────────────────────────────────────────────────────────────║ ā•‘ install │ yarn install --check-cache ā•‘ ║──────────────────────────────────────────────────────────────────────────────║ ā•‘ build │ cross-env npm run clean && cross-env medusa-admin build && tsc ā•‘ ā•‘ │ -p tsconfig.server.json ā•‘ ║──────────────────────────────────────────────────────────────────────────────║ ā•‘ start │ medusa migrations run && medusa start ā•‘ ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•


a year ago

looks better


AnonymousTRIAL

a year ago

Locally my yarn version is 3.5.0 if that matters


a year ago

it does


AnonymousTRIAL

a year ago

and my node version is v20.3.0


a year ago

set engines.node to 20


AnonymousTRIAL

a year ago

locally? or in railway?


a year ago

it would be done on your local project and you push the changes to github


AnonymousTRIAL

a year ago

I see, it's done through package.json, changing that now.


a year ago

does create-medusa-app use yarn or npm by default? yarn


AnonymousTRIAL

a year ago

Ooof, not sure, that was almost a year ago I ran that. I think medusa gave you the option, I seem to remember manually removing the npm stuff.


a year ago

looks like its yarn lock file only


AnonymousTRIAL

a year ago

Ok, that package.json worked to force it to node 20 instead of 18. Learning! (thank you btw, was scouring the internet for hours with no luck, this help is far more directed).


a year ago

that would be outlined here


AnonymousTRIAL

a year ago

So now it's building, but hitting that same 'mime' error now.


a year ago

use yarn v1 locally and sync your lock file again


AnonymousTRIAL

a year ago

Is there a reason to be moving backwards with yarn? Is it because railway doesn't properly support yarn v2?


a year ago

railway uses yarn v1


AnonymousTRIAL

a year ago

Ok, wondering if that will create issues with medusa, which I believe uses yarn v2.


a year ago

they use v1


a year ago

so delete your lock file and then yarn install to make a new one with v1


AnonymousTRIAL

a year ago

Gotcha, now my yarn says version 1.22.19


AnonymousTRIAL

a year ago

Doing that added this to my package.json, do I want the version to be added that specifically?

"packageManager": "yarn@1.22.19"


AnonymousTRIAL

a year ago

And it also added yarnPath: .yarn/releases/yarn-1.22.19.cjs to my .yarnrc.yml file…


a year ago

dont do any of that please


a year ago

railway uses yarn v1 already, all you need to do is use yarn v1 locally and have a v1 lock file in your project


AnonymousTRIAL

a year ago

I think when I rolled back to yarn v1 with yarn set version classic it added those two lines…so I will remove them.


a year ago


AnonymousTRIAL

a year ago

Okay, so that's all re-built, still getting that mime error, any further ideas from the railway side to investigate and figure out when this error actually creeped in? That is, back to the original issue of old deploys working on the same codebase where new deploys are now failing.


a year ago

now it comes down to some issue with your project / deps


a year ago

what solutions have you tried to fix this?


AnonymousTRIAL

a year ago

Well that's where I'm confused, it deployed fully fine a couple months ago, it's just when I redeploy (same code, config, etc) where it starts to fail. The language around that error appears to be a typescript thing, so I'm guessing the typescript version changed in what gets deployed on railway in the past couple months (I had stepped away from the project for a bit). And so my next deploy after that gap in time just now fails. Is there any way to force Railway to deploy with nixpacks versions from a month ago? Or am I thinking about this incorrectly?


AnonymousTRIAL

a year ago

I wanted to add in the type definitions for mime as a test, but as far as I can tell, it's typed right inside the library. So there's nothing to add. I added the latest mime-types anyways, but that didn't work.


AnonymousTRIAL

a year ago

Interestingly, this is what I get from yarn why mime - I have nothing about mime in my package.json though.

ā”œā”€ @types/mime@npm:4.0.0 │ └─ mime@npm:4.0.1 (via npm:*) │ └─ send@npm:0.18.0 └─ mime@npm:1.6.0 (via npm:1.6.0)


a year ago

please can we take the blame away from railway, i understand how it looks but this is not an issue with the platform


AnonymousTRIAL

a year ago

Not blaming, just trying to see that it may be something to do with infra (more likely that I haven't controlled something and it's simply manifesting with an infra change)


a year ago

Is there any way to force Railway to deploy with nixpacks versions from a month ago?
yes

Or am I thinking about this incorrectly?
yes


AnonymousTRIAL

a year ago

I simply want to investigate that as it may help me find the bug.


a year ago

pinning this on railway is only going to cloud your judgment


AnonymousTRIAL

a year ago

It's more that if I can find an old infra it works on, I can step forward and may be able to discover the source of the issue or better debug. But in parallel I'm also trying to figure out the bug with this 'mime' library and typing.


AnonymousTRIAL

a year ago

Arg, somehow yarn has 're-updated' itself to v3.5.0. Not sure how that happened.


a year ago

thats not ideal


AnonymousTRIAL

a year ago

Looks like the moment I removed this line from the .yarnrc.yml it reverted to the v3.5.0


AnonymousTRIAL

a year ago

so that's interesting.


a year ago

remove yarn v3 from your computer


AnonymousTRIAL

a year ago

Yeah, that's what I just figured is a good next step.


AnonymousTRIAL

a year ago

Ok, ran this command corepack prepare yarn@1.22.19 --activate and that worked, will reinstall and redeploy now with yarn v1 (as apparently I never did)


AnonymousTRIAL

a year ago

So this is very weird… I ran yarn why mime :

```~/sites/medusa-app/backend$ yarn why mime
yarn why v1.22.19
[1/4] Why do we have the module "mime"…?
[2/4] Initialising dependency graph…
[3/4] Finding dependency…
[4/4] Calculating file sizes…
=> Found "mime@1.6.0"
info Reasons this module exists

  • "express#send" depends on it

  • Hoisted from "express#send#mime"
    info Disk size without dependencies: "76KB"
    info Disk size with unique dependencies: "76KB"
    info Disk size with transitive dependencies: "76KB"
    info Number of shared dependencies: 0
    => Found "@types/mime#mime@4.0.1"
    info This module exists because "@types#express#@types#serve-static#@types#mime" depends on it.
    info Disk size without dependencies: "168KB"
    info Disk size with unique dependencies: "168KB"
    info Disk size with transitive dependencies: "168KB"
    info Number of shared dependencies: 0```

And then checking express, it's the latest version:

~/sites/medusa-app/backend$ yarn list express yarn list v1.22.19 warning Filtering by arguments is deprecated. Please use the pattern option instead. ā”œā”€ @medusajs/admin@7.1.12 │ └─ express@4.18.2 └─ express@4.19.2

So what doesn't make sense is how latest version of express seems to be using a very OLD version of mime (1.6.0) but a very NEW version of its types (4.0.1).

My package.json sets express as "express": "^4.17.2",

So, PERHAPS the bug is in express…digging in deeper but does this at all make sense to you?


a year ago

have you deleted your node_modules folder and then ran all the same commands railway does to install deps, build and run your project right?


AnonymousTRIAL

a year ago

I did a yarn cache clean, but you're right, should have nuked node_modules for a fresh start.


AnonymousTRIAL

a year ago

Done, didnt' change anything.


a year ago

and then ran all the same commands railway does to install deps, build and run your project right?


AnonymousTRIAL

a year ago

Innnnteresting. Getting the same local error now on yarn build. Only since getting properly on yarn v1. This should help debug without having to deploy!


AnonymousTRIAL

a year ago

More interesting, I just used medusa-create-app to make a fresh medusa install, and the response to yarn why mime is different… NO idea why this would be with my package.json, which refers to the SAME versions of express…

```=> Found "mime@1.6.0"
info Reasons this module exists

  • "express#send" depends on it

  • Hoisted from "express#send#mime"
    info Disk size without dependencies: "76KB"
    info Disk size with unique dependencies: "76KB"
    info Disk size with transitive dependencies: "76KB"
    info Number of shared dependencies: 0```


a year ago

very odd


a year ago

the joys of node dependencies


AnonymousTRIAL

a year ago

Yep, using this to dig further… thank you for your help to date. Recognise this is no longer (that is, never was) a 'railway' thing but nevertheless has been extremely useful.


AnonymousTRIAL

a year ago

So damn weird…

This is what the express and send versions are in the FRESH install:

~/sites/medusa-new-test$ yarn list express warning Filtering by arguments is deprecated. Please use the pattern option instead. ā”œā”€ @medusajs/admin@7.1.12 │ └─ express@4.18.2 └─ express@4.19.2 ~/sites/medusa-new-test$ yarn list send warning Filtering by arguments is deprecated. Please use the pattern option instead. └─ send@0.18.0

And in my install, after removeing the node_modules folder and the yarn.lock file:
~/sites/medusa-app/backend$ yarn list express warning Filtering by arguments is deprecated. Please use the pattern option instead. ā”œā”€ @medusajs/admin@7.1.12 │ └─ express@4.18.2 └─ express@4.19.2 ~/sites/medusa-app/backend$ yarn list send warning Filtering by arguments is deprecated. Please use the pattern option instead. └─ send@0.18.0

Banging head on wall at this point. Same package.json, same actual versions, but somehow this mime v4 in my project seems to be screwing everything up:
=> Found "@types/mime#mime@4.0.1" info This module exists because "@types#express#@types#serve-static#@types#mime" depends on it.


AnonymousTRIAL

a year ago

Going deeper with yarn why @types/mime:

My project:
```~/sites/medusa-app/backend$ yarn why @types/mime
yarn why v1.22.19
[1/4] Why do we have the module "@types/mime"…?
[2/4] Initialising dependency graph…
[3/4] Finding dependency…
[4/4] Calculating file sizes…
=> Found "@types/mime@4.0.0"
info Reasons this module exists

  • "@types#express#@types#serve-static" depends on it

  • Hoisted from "@types#express#@types#serve-static#@types#mime"
    info Disk size without dependencies: "196KB"
    info Disk size with unique dependencies: "272KB"
    info Disk size with transitive dependencies: "272KB"
    info Number of shared dependencies: 1
    => Found "@types/send#@types/mime@1.3.5"
    info This module exists because "@types#express#@types#express-serve-static-core#@types#send" depends on it.
    info Disk size without dependencies: "24KB"
    info Disk size with unique dependencies: "24KB"
    info Disk size with transitive dependencies: "24KB"
    info Number of shared dependencies: 0

And the new test project:

~/sites/medusa-new-test$ yarn why @types/mime
yarn why v1.22.19
[1/4] Why do we have the module "@types/mime"…?
[2/4] Initialising dependency graph…
[3/4] Finding dependency…
[4/4] Calculating file sizes…
=> Found "@types/mime@1.3.5"
info Reasons this module exists

  • "@types#express#@types#serve-static" depends on it

  • Hoisted from "@types#express#@types#serve-static#@types#mime"

  • Hoisted from "@types#express#@types#express-serve-static-core#@types#send#@types#mime"
    info Disk size without dependencies: "24KB"
    info Disk size with unique dependencies: "24KB"
    info Disk size with transitive dependencies: "24KB"
    info Number of shared dependencies: 0```


a year ago

welp time to start over with a new medusa project


AnonymousTRIAL

a year ago

Hah, no way… There must be some way to rectify this. My package.json isn't that much different from default. Is there anything to wipe aside from node_modules and the yarn cache that could be messing w this?


a year ago

i honestly wouldnt know


AnonymousTRIAL

a year ago

WOW! Adding this to my package.json got past that failing build step:

"resolutions": { "@types/mime": "1.3.5" }

Not a great fix, forcing a dependency like this, but at least helps dig deeper…


a year ago

thats node for you šŸ™‚


AnonymousTRIAL

a year ago

One last question, does this seem right in the nixpacks like this with --check-cache? Shouldn't I be wiping the cache in Railway?

╔════════════════ Nixpacks v1.21.2 ═══════════════╗ ā•‘ setup │ nodejs_20, yarn-1_x, postgresql_16 ā•‘ ║─────────────────────────────────────────────────║ ā•‘ install │ yarn install --check-cache ā•‘ ║─────────────────────────────────────────────────║ ā•‘ build │ yarn run build ā•‘ ║─────────────────────────────────────────────────║ ā•‘ start │ yarn run start ā•‘ ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•


a year ago

that is odd


a year ago

its doing that because you have a yarnrc.yml file


AnonymousTRIAL

a year ago

This is what's in my yarnrc.yml file, is this needed or should i nuke that file?

nodeLinker: node-modules


a year ago

yeah get rid of it


AnonymousTRIAL

a year ago

Great, so several wins:

  • I undersand nixpacks better and have a healthier use of it on Railway

  • You've nicely updated Medusa's documentation to avoid future mishaps like mine

  • I "sorta" understand that I have a node dependencies issue and have a short-term hack around it.

Wins and beers around!!


a year ago

and at this point your build has gone out and you are back up?


AnonymousTRIAL

a year ago

Nope, got a bit of a pathway to get there…


AnonymousTRIAL

a year ago

note nixpacks looks like this now:

ā•‘ install │ yarn install --frozen-lockfile ā•‘


a year ago

thats what id expect it to be


a year ago

what other issues are in the way?


AnonymousTRIAL

a year ago

Well now there seems to be an issue with medusa-admin not properly building before I can fully get to my prior state (says that date-fns package isn't available even though it's in the lockfile). I expect I'll get there though, and at that point, Medusa's routes suddenly stopped being registered for some of my medusa plugins and therefore the server application failed to start. Everything I've been blocked on today was simply to try to upgrade Medusa to the latest version to see if I just happened to catch a bug that only manifest in my project at that version. Have done all the necessary database migrations, etc.

All of this is very strange, as again there was no change to my codebase, environment variables, anything (hence my looking at infrastructure). All seems to be quite the tangle. Frustrating as it was all just chugging away working fine from code back before Christmas until last month and then just suddenly started falling apart. Natural return of order to chaos I suppose.


AnonymousTRIAL

a year ago

Hmmm, have just figured out one more 'Railway config' thing I don't understand. I had my nicely working from before Railway instance hooked up to github, and THAT one is failing during build, however I just made a 'fresh' one and it's working. Pointing at the same github branch though. Is there any history / memory / cache at all the Railway github instances hold onto between code deploys? Not sure why the build step would fail on one and succeed on another otherwise..


a year ago

railway does do build caching on a per service bases


AnonymousTRIAL

a year ago

(it's been a service for a while so perhaps it's an old 'version' of the service too, it's been up since the fall)


AnonymousTRIAL

a year ago

Any way to 'clear' the cache?


a year ago

NIXPACKS_NO_CACHE=1


AnonymousTRIAL

a year ago

In the environment variables I assume… Thank you!


a year ago

in the service variables


AnonymousTRIAL

a year ago

Nice. Trying that to see if I can bring my service back to life. If that doesn't work, I'll just use the 'new' one I just made (that works) and then configure it to use SSL (through DNS) etc. to match my 'old' one then retire it. Not my fave method but it'll work.


a year ago

configure it with SSH (through DNS) etc
huh?


AnonymousTRIAL

a year ago

Yep it worked! So that dependency thing in my admin build must have been from a cache issue. Is there a good reason to actually keep caches on in Railway? Seems unfortunate if they can mess w dependencies in this way.


AnonymousTRIAL

a year ago

Basically, I meant using the Networking to set a custom domain, and using DNS to get it to work (with SSL). Sorry spoke unclearly.


a year ago

Is there a good reason to actually keep caches on in Railway?
it would normally speed up builds


a year ago

whats ssh have to do with railway?


AnonymousTRIAL

a year ago

It's not directly, it's more that I use Railway to set redirects to https:// then then I have to set up that domain DNS to the proper Railway server, AND get the SSL (https) certificate. All just tasks that come off of the change in Railway.


a year ago

odd because railway doesnt offer ssh


AnonymousTRIAL

a year ago

Awwww, shoot, everytime I said SSH up there I actually meant SSL, and now I understand your confusion…Oops! Edited my messages for clarity.


a year ago

haha quite confused


AnonymousTRIAL

a year ago

Just talking about this really… and how it requires DNS configuration (completely ourside and not related to Railway) in order to function properly.

1224124543845793800


a year ago

btw you can move your domain over to a new railway service without touching any dns stuff


a year ago

but i assume you already did all that, so this is info for a next time


AnonymousTRIAL

a year ago

Even better, I got the original one working (by nuking the cache through that service variable) so didn't need to migrate at all.


a year ago

oh perfect


AnonymousTRIAL

a year ago

Hah, get this absolute node craziness. Just on a whim, I decided to remove the resolution for mime now that it was all working, and guess what? It works both locally and on Railway. Makes no sense at all, but perhaps it 'kicked' it out of a weird dependency funk by just getting it to work once…


AnonymousTRIAL

a year ago

I mean it does sort of make sense as there's really no logical reason it should have been versioning mime in that inconsistent way…


AnonymousTRIAL

a year ago

(aka node magic)


a year ago

this is indeed node magic


AnonymousTRIAL

a year ago

Further magic. Have switched back to the default NIXPACKS_NO_CACHE=false and lo-and-behold it all still works… Seems this was a 'spider-web-clearing' exercise…


AnonymousTRIAL

a year ago

Ok, full circle and in summary, I now have ALL environments [local, test (on railway), staging (on railway) and prod (on railway)] restored and properly running through a combination of:

  • upgrading medusa

  • cleaning up the nixpacks as per your suggestions

  • clearing the nixpacks cache in Railway with the NIXPACKS_NO_CACHE service variable

  • doing necessary database migrations (unrelated to this issue, but had to be done)

Of interest, to fix prod I did the least amount of manual stuff. That environment never saw the 'resolution' used to fix the 'mime' issue, I simply upgraded from November codebase to now. Then it presented the 'mime' issue, so I added the NIXPACKS_NO_CACHE, redeployed and the issue went away and everything deployed perfectly. So that's of interest for anyone presented with a similar future issue, try a pass of that (you can turn it back to default afterwards) for these weird issues presenting on Railway (or any deployment environment) when using Nixpacks. At this point, I'm actually unsure I needed to upgrade Medusa at all, perhaps the nixpacks cache fix on the old codebase would have been enough, but I can't know at this point as I fixed too fast.


a year ago

I'm pretty sure NIXPACKS_NO_CACHE=false still disables cache, I don't think nixpacks checks if that value is a Boolean, I think it only checks if the value is set to anything and if it's set to anything it disables build caching


a year ago

and I know that at the very least it doesn't clear cache, it just won't use cache for the builds it set on


Railway projects suddenly failing with new "Cannot find type definition file for 'mime'" Error - Railway Help Station