Railpack cannot resolve types from @vue/compiler-sfc

q16solverPRO

2 months ago

Hi, I wanted to switch from nixpacks to railpack since it seems like nixpacks doesn't support symlinks. Then railpack builds work all the way up to building the main app in my monorepo, then fails to resolve the types from vue for some reason, this has never happened before with nixpacks, so I assume there may be some issue with railpack here.

18 Replies

2 months ago

Can you give me the specific error you see?


Status changed to Awaiting User Response railway[bot] about 2 months ago


q16solverPRO

2 months ago

https://railway.com/project/ee3ff836-fbe7-48a5-801b-c3dae81a5d84/service/13ef64fd-fd39-4b93-95ca-8aae1f557fb5?environmentId=a380882c-1e36-41df-9638-123f0af91a36&id=aaf21cc1-2424-441b-93d3-307c0830e86c#build

[log] [nuxi] Nuxt 3.16.2 with Nitro 2.11.9

[info] [nuxt] Running with compatibility version 4

[info] [nuxi] Building for Nitro preset: node-server

[success] Nitro config hot reloaded!

[info] Building client...

[info] [36mvite v6.3.2 [32mbuilding for production...[36m[39m

[info] transforming...
[info] [32m✓[39m 984 modules transformed.

 ELIFECYCLE  Command failed with exit code 1.

at makeError (file:///app/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js:60:11)

at handlePromise (file:///app/node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js:124:26)

at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

at async file:///app/node_modules/.pnpm/p-queue@8.1.0/node_modules/p-queue/dist/index.js:230:36 {

shortMessage: 'Command failed with exit code 1: corepack pnpm run build',

command: 'corepack pnpm run build',

escapedCommand: 'corepack pnpm run build',

exitCode: 1,

signal: undefined,

signalDescription: undefined,

stdout: '\n' +

'> @esposter/app@2.0.0 build /app/packages/app\n' +

'> cross-env NODE_OPTIONS=--max-old-space-size=8192 nuxt build\n' +

'\n' +

'[log] [nuxi] Nuxt 3.16.2 with Nitro 2.11.9\n' +

'[info] [nuxt] Running with compatibility version 4\n' +

'[info] [nuxi] Building for Nitro preset: node-server\n' +

'[success] Nitro config hot reloaded!\n' +

'[info] Building client...\n' +

'[info] \x1B[36mvite v6.3.2 \x1B[32mbuilding for production...\x1B[36m\x1B[39m\n' +

'[info] transforming...\n' +

'[info] \x1B[32m✓\x1B[39m 984 modules transformed.\n' +

' ELIFECYCLE  Command failed with exit code 1.',

stderr: '[error] \x1B[31m✗\x1B[39m Build failed in 13.67s\n' +

'[error] [nuxi] Nuxt Build Error: \x1B[31m[vite:vue] [@vue/compiler-sfc] Failed to resolve import source "@/components/Clicker/Svg/Group.vue".\n' +

'\n' +

'/app/packages/app/app/components/Clicker/Model/Item.vue\n' +

'2 | import type { ClickerSvgGroupProps } from "@/components/Clicker/Svg/Group.vue";\n' +

'3 | \n' +
'4 | const svgGroupProps = defineProps<ClickerSvgGroupProps>();\n' +

' | ^^^^^^^^^^^^^^^^^^^^\n' +

'5 | const emit = defineEmits<{ click: [event: MouseEvent] }>();\n' +

'6 | const clickerItemProperties = useClickerItemProperties();\x1B[39m\n' +

'file: \x1B[36m/app/packages/app/app/components/Clicker/Model/Item.vue\x1B[39m\n' +

' at ScriptCompileContext.error (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:19741:11)\n' +

' at importSourceToScope (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:22626:16)\n' +

' at resolveTypeFromImport (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:22579:23)\n' +

' at innerResolveTypeReference (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:22466:14)\n' +

' at resolveTypeReference (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:22454:20)\n' +

' at innerResolveTypeElements (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:22055:24)\n' +

' at resolveTypeElements (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:21995:20)\n' +

' at resolveRuntimePropsFromType (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:23632:20)\n' +

' at extractRuntimeProps (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:23608:17)\n' +

' at genRuntimeProps (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:23596:18)\n' +

' at Object.compileScript (/app/node_modules/.pnpm/@vue+compiler-sfc@3.5.13/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:24709:21)\n' +


Status changed to Awaiting Railway Response railway[bot] about 2 months ago


2 months ago

It seems like a bug in your code?

[error] [nuxi] Nuxt Build Error: [vite:vue] [@vue/compiler-sfc] Failed to resolve import source "@/components/Clicker/Svg/Group.vue".

/app/packages/app/app/components/Clicker/Model/Item.vue

2 | import type { ClickerSvgGroupProps } from "@/components/Clicker/Svg/Group.vue";

3 |

4 | const svgGroupProps = defineProps<ClickerSvgGroupProps>();

| ^^^^^^^^^^^^^^^^^^^^

5 | const emit = defineEmits<{ click: [event: MouseEvent] }>();

6 | const clickerItemProperties = useClickerItemProperties();


Status changed to Awaiting User Response railway[bot] about 2 months ago


q16solverPRO

2 months ago

At first I thought so as well… but the builds in nixpacks has been working for months and the codes been there for a long time, and my pipelines are working as well, it might be that the dependencies that railway installs aren’t the same? Node ver seems fine, not sure if there are any other weird deps


Status changed to Awaiting Railway Response railway[bot] about 2 months ago


q16solverPRO

2 months ago

The GitHub project I’m trying to build here in case that helps at all https://github.com/Esposter/Esposter

The pipeline builds in GitHub actions have been working for the part railpack says it’s failing for, and the code has been introduced for months, nixpacks also seems fine (until I introduced symlinks so I wanted to switch, that has nothing to do with this though, it gives me the same error before symlinks were introduced)


q16solverPRO

2 months ago

Any update on this?


echohackEMPLOYEE

2 months ago

Hi q16solver,

This does look like an error in your code. You can see

This build failed: https://railway.com/project/ee3ff836-fbe7-48a5-801b-c3dae81a5d84/service/13ef64fd-fd39-4b93-95ca-8aae1f557fb5?environmentId=a380882c-1e36-41df-9638-123f0af91a36&id=87940877-7d09-4e6f-acbb-5f47158bb50d#build

Whereas the build associated with this commit is the last known good build: https://github.com/Esposter/Esposter/commit/c14e2c15f06d1f22b65a07e1a3eca61bda637d39

Because your repo is public I pulled it and was able to successfully build from commit c14e2c. I believe shortly after that commit you introduced a configuration change that caused the error above to result in that code becoming unreachable. So I can confirm that there's no drift in Nixpacks and the issue is with your application configuration.

You'll need to look at your application configuration and ensure that Nixpacks can reach the code in question at build time with the correct configuration.

Attachments


Status changed to Awaiting User Response railway[bot] about 2 months ago


q16solverPRO

2 months ago

Hi! Thanks for the investigation, but the issue there (I assume you were using nixpacks) is because I introduced symlinks, which was why I switched to railpack in the first place, but without it, this would still fail in railpack, but work in nixpacks, I’ll see if I can use a different environment to show a reproduction of this working in nixpacks but not railpack


Status changed to Awaiting Railway Response railway[bot] about 2 months ago


q16solverPRO

2 months ago

The error is reproduced in the develop branch and development environment in railway after I removed all the symlinks since nixpacks doesn't support that,

Nixpacks build working with latest commit on develop branch:
https://railway.com/project/ee3ff836-fbe7-48a5-801b-c3dae81a5d84/service/13ef64fd-fd39-4b93-95ca-8aae1f557fb5?environmentId=3cbf9acc-1f52-40e5-9fe2-4a8fee89ff6e&id=2fe61077-f88d-4f92-973d-a899eaf7288c#build

Directly switch to Railpack build failing with the same resolve error:
https://railway.com/project/ee3ff836-fbe7-48a5-801b-c3dae81a5d84/service/13ef64fd-fd39-4b93-95ca-8aae1f557fb5?environmentId=3cbf9acc-1f52-40e5-9fe2-4a8fee89ff6e&id=50bab51f-4e30-4761-a3fc-14b1c4b42a8f#build

The CI/CD I run on github also runs build, lint and typechecking, so it's very hard to imagine that it's a code issue from my side along with the fact it's pointing to very old code I've had for months, it may most likely be some dependency resolution issue in railpack


echohackEMPLOYEE

2 months ago


Status changed to Awaiting User Response railway[bot] about 2 months ago


q16solverPRO

a month ago

Hi, just wanted to do a quick followup here, in the github issue I did a little investigation and I think it's just that railpack is missing the COPY app command in docker which nixpacks hard codes apparently, details in the issue, just wanted to know if we can look into this and see if that would fix it


Status changed to Awaiting Railway Response railway[bot] about 1 month ago


railway[bot]

a month ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


q16solverPRO

a month ago

Hopefully this can be fixed soon since I think it should be a quick enough fix, but would also fix builds that use a monorepo like this c:


railway[bot]

a month ago

🛠️ The internal ticket Build fails with "failed to resolve import source for @vue/compiler-sfc" has been marked as todo.


railway[bot]

24 days ago

🛠️ The internal ticket Build fails with "failed to resolve import source for @vue/compiler-sfc" has been marked as in progress.


railway[bot]

24 days ago

✅ The internal ticket Build fails with "failed to resolve import source for @vue/compiler-sfc" has been marked as completed.



q16solverPRO

18 days ago

fixed as of railpack v0.0.66