Giter Site home page Giter Site logo

Comments (4)

mdonnalley avatar mdonnalley commented on July 22, 2024

@wataruian I'm not seeing this happen on a newly generated CLI (either from the CJS template or the ESM template)

Can you create a simple repository that replicates the issue? It'd also be helpful if you provided the logs from setting the DEBUG=config:ts-node environment variable. That should tell us why it's skipping the compilation step. Thanks!

from core.

wataruian avatar wataruian commented on July 22, 2024

I can't easily reproduce the repo since I am using a large monorepo, but for context:

I tried creating a new command that just do console.log() and it works just fine.

But I am getting an issue when the command actually uses lodash - isNil().

module: @oclif/[email protected]
task: cacheCommand
plugin: @wataruian/cli
root: /Users/wataruian/monorepo/packages/cli
See more details with DEBUG=*
TypeError Plugin: @wataruian/cli: Cannot read properties of undefined (reading 'isNil')
    at Object.<anonymous> (/Users/wataruian/monorepo/packages/cli/src/configs/project.ts:83:12)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module.m._compile (/Users/wataruian/monorepo/.yarn/__virtual__/ts-node-virtual-6f9ee5be06/0/cache/ts-node-npm-10.9.1-6c268be7f4-090adff130.zip/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at require$$0.Module._extensions..js (/Users/wataruian/monorepo/.pnp.cjs:45357:33)
    at Object.require.extensions.<computed> [as .ts] (/Users/wataruian/monorepo/.yarn/__virtual__/ts-node-virtual-6f9ee5be06/0/cache/ts-node-npm-10.9.1-6c268be7f4-090adff130.zip/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Function.Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.require$$0.Module._load (/Users/wataruian/monorepo/.pnp.cjs:45202:31)
    at Module.require (node:internal/modules/cjs/loader:1141:19)

I tried recreating the issue on a repo with just single package but using lodash seems to work there. So it is hard to pinpoint the actual issue.

But the line that is having the issue is just checking if the env var is existing and assigns a value:

const value = !_.isNil(process.env['TEST_VALUE']) ? process.env['TEST_VALUE'] : 'some-test-value';

I am not sure if the issue is with oclif, lodash, ts-node, workspaces or pnp itself (too many factors to consider).

Feel free to close this issue. I'll try to reproduce and debug on my end.

from core.

mdonnalley avatar mdonnalley commented on July 22, 2024

@wataruian Thanks - feel free to reopen the issue if you trace it down to something in oclif

from core.

wataruian avatar wataruian commented on July 22, 2024

@mdonnalley it's weird, doing yarn cache clean && yarn install and rerunning the command works on my mono repo now. 😄

We can close this officially.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.