Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on MacOS but not Stackblitz -- no transform has been configured -- due to PNPM hoisting #883

Closed
RDeluxe opened this issue Apr 24, 2024 · 1 comment

Comments

@RDeluxe
Copy link

RDeluxe commented Apr 24, 2024

Summary

My code works on Stackblitz but not my local machine, and I've no clear idea of why. Yes, I know it sounds a bit stupid, but I thought you may have an idea of how to debug Nestia considering it's doing some funky package patching.

  • Nestia version: 5.2.3-dev.20240219
  • Expected behavior: My NestJS starts correctly
  • Actual behavior: The app crashes with the following error:
Error: Error on nestia.core.TypedRoute.Post(): no transform has been configured. Run "npx typia setup" command, or check if you're using non-standard TypeScript compiler like Babel or SWC.

After installing nestia and launching the setup command, I added a single route following nestia's documentation.
However my app crashes at startup with the error cited above.

Code occuring the bug

import { TypedRoute } from '@nestia/core'
import { Body, Controller, Post } from '@nestjs/common'
import { Source } from '@prisma/client'

export interface LaunchParsingDTO {
  source: Source
  dryRun?: boolean
}

@Controller('flux')
export class FluxController {
  @TypedRoute.Post('parse')
  parse(@Body() launchParseDTO: LaunchParsingDTO): void {
    console.log(launchParseDTO)
  }
}

I trimmed down my codebase and created a new repository here repository, and Stackblitz.

The crazy thing is, with the exact same version of Node, NPM and PNPM, the code is failing on my machine (MacOS M1) but runs on Stackblitz.

@RDeluxe
Copy link
Author

RDeluxe commented Apr 24, 2024

Alright, I figured it was due to PNPM due to the fact it worked on Stackblitz.

It seems like this settings in my npmrc file was the culprit :

node-linker=hoisted

I suspect this was screwing up with the package patching somehow.

I'm closing the issue but you may want to take a look at it anyway. Also changing the title for future references.

@RDeluxe RDeluxe changed the title Error on MacOS but not Stackblitz -- no transform has been configured Error on MacOS but not Stackblitz -- no transform has been configured -- due to PNPM hoisting Apr 24, 2024
@RDeluxe RDeluxe closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant