ts-force icon indicating copy to clipboard operation
ts-force copied to clipboard

Error: Cannot find module '../../ts-force'

Open andrenarchy opened this issue 4 years ago • 1 comments

I am using ts-force-gen in a repository that is using rush/pnpm for handling dependencies and it fails with

Error: Cannot find module '../../ts-force'

I noticed there are indeed relative imports to import the ts-force module. They work locally in development and apparently also with npm because it places the dependency in the same relative position. In order to support all environments these relative imports should be changed to an absolute import of ts-force.

andrenarchy avatar Aug 31 '21 06:08 andrenarchy

exact same issue here, also using pnpm

requireStack: [
    '/Users/dacloutier/Documents/vscode/com.go2.wtj.e2e/node_modules/.pnpm/[email protected]/node_modules/ts-force-gen/build/sObjectGenerator.js',
    '/Users/dacloutier/Documents/vscode/com.go2.wtj.e2e/node_modules/.pnpm/[email protected]/node_modules/ts-force-gen/build/index.js'
  ]

just replacing with

const ts_force_1 = require("ts-force");

worked for pnpm, no idea if this would have impact on npm and the others.

dacloutier-logmein avatar Oct 23 '24 22:10 dacloutier-logmein