wallabyjs / quokka

Repository for Quokka.js questions and issues
https://quokkajs.com
1.17k stars 31 forks source link

Issues using Quokka with Turborepo #927

Closed loganpowell closed 6 months ago

loganpowell commented 6 months ago

Issue description or question

Is this issue related to Quokka not outputting the expected results of your code?: Yes

I am trying to run quokka in a typescript monorepo using Turbo repo, but module resolution is choking. I've tried to install the hidden dependency, which is actually already included in my turborepo root node_modules, so I'm not sure how to proceed.

Any tips from someone with experience with these two technologies together?

Sample code

import { myFunction } from 'my-package'

Quokka.js Console Output

​Install "@azure/msal-node" package for the current quokka file​
​Install "@azure/msal-node" package into the project​
Cannot find module '@azure/msal-node' 
Require stack: 
- ./node_modules/@azure/identity/dist/index.js 
- ./packages/my-package/dist/index.js 
- ./apps/my-app/src/index.js 
  ​​​​​at ​​​​​​​​Proxy.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue​​​ ​./node_modules/@cspotcode/source-map-support/source-map-support.js:811​
  ​​​​​at ​​​​​​./node_modules/@azure/identity/dist/index.js:5​
  ​​​​​at ​​​​​​​​Object.<anonymous>​​​ ​./node_modules/@azure/identity/dist/index.js:4290​
  ​​​​​at ​​​​​​​​Object.require.extensions.<computed> [as .js]​​​ ​./node_modules/ts-node/src/index.ts:1608​
  ​​​​​at ​​​​​​./packages/vault/dist/index.js:4​
  ​​​​​at ​​​​​​​​Object.<anonymous>​​​ ​./packages/vault/dist/index.js:58​
  ​​​​​at ​​​​​​​​Object.m._compile​​​ ​./node_modules/ts-node/src/index.ts:1618​
  ​​​​​at ​​​​​​​​Object.require.extensions.<computed> [as .js]​​​ ​./node_modules/ts-node/src/index.ts:1621​
  ​​​​​at ​​​​​​./packages/config/dist/index.js:32​
  ​​​​​at ​​​​​​​​Object.<anonymous>​​​ ​./packages/config/dist/index.js:88​
  ​​​​​at ​​​​​​​​Object.m._compile​​​ ​./node_modules/ts-node/src/index.ts:1618​

Code editor version

Visual Studio Code v: 1.85.1

OS name and version

OSX: Macbook Pro (M2): 14.2.1 (23C71)

ArtemGovorov commented 6 months ago

Can you please try running the same file with ts-node outside of Quokka to see if module resolution is working correctly there?

loganpowell commented 6 months ago

Hi @ArtemGovorov. Good to hear from you. Yes, it works with ts-node

ArtemGovorov commented 6 months ago

@loganpowell Thanks for checking! Can you please share:

smcenlly commented 6 months ago

@loganpowell - are you able to provide the details Artem requested so that we can continue our investigation for you?

smcenlly commented 6 months ago

Closing this issue since we haven't heard back. If you reply with the details requested, we'll reopen the issue.

loganpowell commented 6 months ago

Sorry for the delayed response, but I thought this issue was resolved by the latest update, which fixed it. I thought that notice was in this thread. Everything works now.

loganpowell commented 6 months ago

This fixed it

https://github.com/wallabyjs/quokka/issues/925