-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Remix Crystal Plugin unable to create nodes on Windows #21936
Comments
I was able to get the project running by changing the file extension to CommonJS (.cjs) -> remix.config.cjs. You probably wanna update the config so it fits your needs. /**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
ignoredRouteFiles: ['**/.*'], // appDirectory: "app",
serverModuleFormat: "esm",
tailwind: true,
browserNodeBuiltinsPolyfill: {
modules: {
buffer: true, events: true,
assert: true, util: true, url: true, stream: true, crypto: true, dns: true, net: true, tls: true, string_decoder: true
}
},
watchPaths: () => require('@nx/remix').createWatchPaths(__dirname)
}; |
@sowedoO unfortunately that didn't work for me either.
[Nxls] - 2024-03-01T12:40:24.941Z - Retrieving workspace configuration
[Nxls] - 2024-03-01T12:40:25.042Z - Using local Nx package at f:/sandbox/sandbox/node_modules/nx/src/project-graph/project-graph.js
[Nxls] - 2024-03-01T12:40:25.045Z - Using local Nx package at f:/sandbox/sandbox/node_modules/nx/src/project-graph/file-utils.js
[Nxls] - 2024-03-01T12:40:25.046Z - Using local Nx package at f:/sandbox/sandbox/node_modules/nx/src/utils/output.js
[Nxls] - 2024-03-01T12:40:25.046Z - Using local Nx package at f:/sandbox/sandbox/node_modules/nx/src/project-graph/file-map-utils.js
[Nxls] - 2024-03-01T12:40:25.046Z - Using local Nx package at f:/sandbox/sandbox/node_modules/nx/src/daemon/client/client.js
[Nxls] - 2024-03-01T12:40:25.046Z - createProjectGraphAndSourceMapsAsync
[Nxls] - 2024-03-01T12:40:26.055Z - Unable to get project graph
[Nxls] - 2024-03-01T12:40:26.055Z - Error: Unable to create nodes for apps/my-app/remix.config.cjs using plugin @nx/remix/plugin.
Inner Error: f:\sandbox\sandbox\apps\my-app\remix.config.cjs:1
import { dirname } from 'path';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1185:20)
at Module._compile (node:internal/modules/cjs/loader:1227:27)
at Object..js (node:internal/modules/cjs/loader:1326:10)
at Module.load (node:internal/modules/cjs/loader:1126:32)
at node:internal/modules/cjs/loader:967:12
at Function._load (node:electron/js2c/node_init:2:13357)
at Module.require (node:internal/modules/cjs/loader:1150:19)
at require (node:internal/modules/cjs/helpers:121:18)
at load (F:\sandbox\sandbox\node_modules\.pnpm\@nx+devkit@18.0.6_nx@18.0.6\node_modules\@nx\devkit\src\utils\config-utils.js:65:16)
at F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\project-graph\utils\project-configuration-utils.js:156:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Promise.all (index 0)
at async Promise.all (index 1)
at async createProjectConfigurations (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\project-graph\utils\retrieve-workspace-files.js:89:62)
at async processFilesAndCreateAndSerializeProjectGraph (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:140:28)
at async getCachedSerializedProjectGraphPromise (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\daemon\server\project-graph-incremental-recomputation.js:43:16)
at async handleRequestProjectGraph (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\daemon\server\handle-request-project-graph.js:12:24)
at async handleResult (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\daemon\server\server.js:110:16)
at async handleMessage (F:\sandbox\sandbox\node_modules\.pnpm\nx@18.0.6_@swc-node+register@1.8.0_@swc+core@1.3.107\node_modules\nx\src\daemon\server\server.js:81:9)
[Nxls] - 2024-03-01T12:40:26.055Z - Resetting daemon client
[Nxls] - 2024-03-01T12:40:26.055Z - Retrieved workspace configuration in: 1114.1792998313904 ms |
revisited this because i really want to use vite within an nx monorepo. managed to at least get it building and running locally with just the rename of the remix config to a .cjs extension and the following in the config at a bare minimum. these changes made straight after scaffolding a new remix app. /**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
ignoredRouteFiles: ['**/.*'],
appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
watchPaths: function () {
return require('@nx/remix').createWatchPaths(__dirname)
}
}; |
Just stumbled across the same issue again (new project). Seems like this issue is still not fixed in NX 18.2.3. |
@sowedoO The release notes would have been updated to indicate if this was fixed, and this issue would have been closed 🙂 . This is still an issue, and it's on my list, and I will get to it as soon as I can. This issue will be closed when it is merged, and a subsequent release will be made containing the fix. I can't give you a timeframe on when that will be. If this is blocking you and you have time and motivation, feel free to open a PR fixing this issue. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Windows 11 OS, node 20 LTS, all latest versions as of 22 feb 2024
Originally posted by @binaryartifex in #21714 (comment)
The text was updated successfully, but these errors were encountered: