-
Notifications
You must be signed in to change notification settings - Fork 10
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
[Bug] Functions Entrypoint generates invalid Import on Windows #275
Comments
The problem seems to be that This code piece is generated by https://github.com/netlify/remix-compute/blob/0bfe42de2205537528fd6c72d1f95a81798e09b7/packages/remix-adapter/src/plugin.ts#L18C32-L18C38, and it seems that we're generating a Windows path where we should be generating a Unix path instead. I'll move this issue over to that repository. |
This has been resolved in #281. Please ensure you are using |
I think I am running the correct version of Remix. See the attached files. |
We released a new version of One way to verify what version you are using is to run
|
Hi Mateusz Bocian,
I ran ‘npm install’ and I still get 2.3.0. What am I doing wrong.
Thank you
Peter Schaeffer
From: Mateusz Bocian ***@***.***>
Sent: Wednesday, April 3, 2024 3:41 PM
To: netlify/remix-compute ***@***.***>
Cc: Peter Schaeffer ***@***.***>; Author ***@***.***>
Subject: Re: [netlify/remix-compute] [Bug] Functions Entrypoint generates invalid Import on Windows (Issue #275)
We released a new version of remix-adapter today, you'll have to update your code to use it and try again. The project pschaeffer/my-remix-udemy-section3-netlify3 <https://github.com/pschaeffer/my-remix-udemy-section3-netlify3/blob/main/package-lock.json#L1406-L1426> is still using v2.3.0.
One way to verify what version you are using is to run npm list in the root of the project and ensuring that the following shows up:
...
├── @***@***.***
..
—
Reply to this email directly, view it on GitHub <#275 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4LSSWZTDXCQPCX62OBLALY3RSPNAVCNFSM6AAAAABFI6UNB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZVGU2DGNRSGU> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AA4LSSSXN7YJATGFIKN7SSLY3RSPNA5CNFSM6AAAAABFI6UNB2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZKPXES.gif> Message ID: ***@***.*** ***@***.***> >
|
You can specify |
Hi Mateusz Bocian,
I upgraded to 2.3.1 as you suggested and then verified (using npm list) that I had 2.3.1.
Netlify4 (actually all lowercase) seems to work correctly with ‘netlify serve’ and ‘netlify dev’ (no quotes of course).
By contrast, netlify3 still has some problems. ‘netlify dev’ (no quotes of course) gets some errors. See Capture1.PNG and Capture2.PNG.
‘netlify serve’ (no quotes of course) gets some errors. See Capture3.PNG and Capture4.PNG and Capture5.PNG
Thank you
Peter Schaeffer
From: Mateusz Bocian ***@***.***>
Sent: Wednesday, April 3, 2024 11:30 PM
To: netlify/remix-compute ***@***.***>
Cc: Peter Schaeffer ***@***.***>; Author ***@***.***>
Subject: Re: [netlify/remix-compute] [Bug] Functions Entrypoint generates invalid Import on Windows (Issue #275)
You can specify ***@***.***/remix-adapter": "^2.3.1", in your <https://github.com/pschaeffer/my-remix-udemy-section3-netlify3/blob/main/package.json#L15> package.json and then try running npm install once again.
—
Reply to this email directly, view it on GitHub <#275 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4LSSX2OHEHVJM3QBJSRATY3TJKXAVCNFSM6AAAAABFI6UNB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZWGE3TAMJYGY> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AA4LSSURLPURY4NQQL2TMDTY3TJKXA5CNFSM6AAAAABFI6UNB2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZLV64U.gif> Message ID: ***@***.*** ***@***.***> >
|
Peter, it looks like the screenshots weren't properly attached to your reply. Could you try posting them again within the GitHub UI? The reply-via-email feature seems to be lacking in formatting & attachments. |
You should have all the screenshots at this point. I updated my-remix-udemy-section3-netlify3 with the newest code. Note that this repository does not include the node_folders folder. It was too large for git. |
Hi Mateusz Bocian,
I used a github comment to add all of the screenshots.
Thank you
Peter Schaeffer
From: ***@***.*** ***@***.***>
Sent: Wednesday, April 3, 2024 4:11 PM
To: 'netlify/remix-compute' ***@***.***>; 'netlify/remix-compute' ***@***.***>
Cc: 'Author' ***@***.***>
Subject: RE: [netlify/remix-compute] [Bug] Functions Entrypoint generates invalid Import on Windows (Issue #275)
Hi Mateusz Bocian,
I ran ‘npm install’ and I still get 2.3.0. What am I doing wrong.
Thank you
Peter Schaeffer
From: Mateusz Bocian ***@***.*** ***@***.***> >
Sent: Wednesday, April 3, 2024 3:41 PM
To: netlify/remix-compute ***@***.*** ***@***.***> >
Cc: Peter Schaeffer ***@***.*** ***@***.***> >; Author ***@***.*** ***@***.***> >
Subject: Re: [netlify/remix-compute] [Bug] Functions Entrypoint generates invalid Import on Windows (Issue #275)
We released a new version of remix-adapter today, you'll have to update your code to use it and try again. The project pschaeffer/my-remix-udemy-section3-netlify3 <https://github.com/pschaeffer/my-remix-udemy-section3-netlify3/blob/main/package-lock.json#L1406-L1426> is still using v2.3.0.
One way to verify what version you are using is to run npm list in the root of the project and ensuring that the following shows up:
...
├── @***@***.***
..
—
Reply to this email directly, view it on GitHub <#275 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4LSSWZTDXCQPCX62OBLALY3RSPNAVCNFSM6AAAAABFI6UNB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZVGU2DGNRSGU> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AA4LSSSXN7YJATGFIKN7SSLY3RSPNA5CNFSM6AAAAABFI6UNB2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZKPXES.gif> Message ID: ***@***.*** ***@***.***> >
|
The second screenshot doesn't look to have uploaded properly, however based on the first screenshot alone this doesn't look to be related to the original issue you posted about (i.e. When I download your repository If you are certain your project is configured correctly and the issue is elsewhere, then we need your help! Please open up a new issue in the appropriate repository (e.g. remix, remix-adapter, netlify-cli, node), and please include a minimal reproducible example to help the community zero in on the root cause of the problem. Here is a helpful resource describing how to create minimal reproducible examples . |
Describe the bug
I am getting an error when I try to run my application. I am not sure if this is a node error or Netlify error or a Remix error. See below. I get the error shown below. What does node:internal mean? I have no idea.
Function remix-server has returned an error: Invalid module "...uildserverserver.js" is not a valid package name imported from C:\Users\Peter\Documents\Visual_Studio_Code\Projects\WebApplication5\WebApplication5\my-remix-udemy-section3-netlify2.netlify\functions-serve.unzipped\remix-server\remix-server.mjs
TypeError: Invalid module "...uildserverserver.js" is not a valid package name imported from C:\Users\Peter\Documents\Visual_Studio_Code\Projects\WebApplication5\WebApplication5\my-remix-udemy-section3-netlify2.netlify\functions-serve.unzipped\remix-server\remix-server.mjs
at new NodeError (node:internal/errors:406:5)
at parsePackageName (node:internal/modules/esm/resolve:718:11)
at packageResolve (node:internal/modules/esm/resolve:740:5)
at moduleResolve (node:internal/modules/esm/resolve:838:20)
at defaultResolve (node:internal/modules/esm/resolve:1043:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36)
Response with status 500 in 446 ms.
Steps to reproduce
Execute 'netlify serve'. For some reason 'netlify dev' works.
Configuration
[build]
command = "npx prisma generate && npm run build"
publish = "build/client"
[dev]
command = "npm run dev"
framework = "vite"
Set immutable caching for static files, because they have fingerprinted filenames
[[headers]]
for = "/build/*"
[headers.values]
"Cache-Control" = "public, max-age=31560000, immutable"
Environment
Quite standard. The code below is being stored in .netlify/functions-server/.unzipped/remix-server/remix-server.mjs
import {createRequire as ___nfyCreateRequire} from "module";
import {fileURLToPath as ___nfyFileURLToPath} from "url";
import {dirname as ___nfyPathDirname} from "path";
let __filename=___nfyFileURLToPath(import.meta.url);
let __dirname=___nfyPathDirname(___nfyFileURLToPath(import.meta.url));
let require=___nfyCreateRequire(import.meta.url);
// .netlify/functions-internal/remix-server.mjs
import { default as default2 } from "....\buildserverserver.js";
var config = {
name: "Remix server handler",
generator: "@netlify/remix-adapter@2.3.0",
path: "/*",
preferStatic: true
};
export {
config,
default2 as default
};
The text was updated successfully, but these errors were encountered: