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

[vite] appRootPath is undefined in vite.config.ts #282

Open
HipyCas opened this issue Jan 16, 2023 · 0 comments
Open

[vite] appRootPath is undefined in vite.config.ts #282

HipyCas opened this issue Jan 16, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@HipyCas
Copy link

HipyCas commented Jan 16, 2023

Current Behavior

I created a fresh project with @nx-plus/vite and Vue. It worked, until I added a path alias to tsconfig.base.json. Now, it is giving me the following error when executing:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:388:5)
    at validateString (node:internal/validators:114:11)
    at join (node:path:1172:7)
    at /home/hipy/ceebi/code2/apps/admin/vite.config.ts:73:57
    at Array.map (<anonymous>)
    at /home/hipy/ceebi/code2/apps/admin/vite.config.ts:73:22
    at Array.reduce (<anonymous>)
    at Object.<anonymous> (/home/hipy/ceebi/code2/apps/admin/vite.config.ts:70:72)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at _require.extensions.<computed> [as .js] (file:///home/hipy/ceebi/code2/node_modules/vite/dist/node/chunks/dep-5605cfa4.js:63154:24)

Which seems to come from the following import at the top:

import { appRootPath } from '@nrwl/tao/src/utils/app-root';

I installed @nrwl/tao as a dev dependency, but it didn't fix it and appRootPath is showing up as undefined.

Expected Behavior

Use some way that does not use part of a library that is not exported and thus undefined.

Steps to Reproduce

  1. Create a new project in a fresh workspace.
  2. Define a path in tsconfig.base.json in the workspace root, for example "@code/*": ["libs/*/src/index.ts"] (the one that nx defines for libs).
  3. Run either nx serve my-app or nx build my-app and see it fail.

Failure Logs

Already included above, I have no more logs to show

Environment

Plugin name and version: @nx-plus/vite@15.0.0-rc.0

>  NX   Report complete - copy this into the issue template

   Node : 18.4.0
   OS   : linux x64
   npm  : 8.12.1
   
   nx : 15.5.1
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.5.1
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.5.1
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.5.1
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 15.5.1
   @nrwl/js : 15.5.1
   @nrwl/linter : 15.5.1
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 15.0.2
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : Not Found
   @nrwl/workspace : 15.5.1
   @nrwl/vite : Not Found
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
         @nx-plus/vite: 15.0.0-rc.0
@HipyCas HipyCas added the bug Something isn't working label Jan 16, 2023
@HipyCas HipyCas changed the title [vite] appRootPath is undefined in `vite.config.ts [vite] appRootPath is undefined in vite.config.ts Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant