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

can't run with Remix 2.5.1 or 2.6.0 #17

Closed
marcob896 opened this issue Feb 3, 2024 · 7 comments
Closed

can't run with Remix 2.5.1 or 2.6.0 #17

marcob896 opened this issue Feb 3, 2024 · 7 comments

Comments

@marcob896
Copy link

marcob896 commented Feb 3, 2024

Hi,
I can't seem to make this template work.
I just cloned it, ran npm install and then npm run dev.
This is the output of the console:

> dev
> node -r ts-node/register --watch-path ./server.ts server.ts

(node:10796) ExperimentalWarning: Watch mode is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Failed running 'server.ts'

I'm on Node v18.16.0
I filled the env variables.

Can you help me figuring out what's wrong?

@marcob896
Copy link
Author

marcob896 commented Feb 4, 2024

ok , I've managed to get it started, recreating the local mongo container. I don't know what was wrong...
Now I can spin up the server, I see the home page, but the Payload admin route is just blank...

Any idea?

In the browser console I see the following error:

index.js:300  Uncaught TypeError: (0 , _reactRouterDom.withRouter) is not a function
    at Object.<anonymous> (index.js:300:39)
    at __webpack_require__ (index.js:21:30)
    at index.js:64:18
    at node_modules/react-router-navigation-prompt/es/index.js (index.js:65:10)
    at __require2 (chunk-FOWDQQBS.js?v=2112d5a8:19:50)
    at node_modules/payload/dist/admin/components/modals/LeaveWithoutSaving/index.js (index.tsx:2:34)
    at __require2 (chunk-FOWDQQBS.js?v=2112d5a8:19:50)
    at node_modules/payload/dist/admin/components/views/LivePreview/index.js (index.tsx:1:44)
    at __require2 (chunk-FOWDQQBS.js?v=2112d5a8:19:50)
    at node_modules/payload/dist/admin/components/views/Global/Routes/CustomComponent.js (CustomComponent.tsx:1:19)

@xHomu
Copy link
Collaborator

xHomu commented Feb 4, 2024

looking into it.

@xHomu
Copy link
Collaborator

xHomu commented Feb 4, 2024

Can you pull the latest commits and see if that fixed the issue for you?

Just in case it was something particular to my local, I also made a test deploy to https://repay.fly.dev/ and it seemed to be working.

@marcob896
Copy link
Author

Can you pull the latest commits and see if that fixed the issue for you?

Just in case it was something particular to my local, I also made a test deploy to https://repay.fly.dev/ and it seemed to be working.

Thanks for the fast reply but...I still have the same behaviour.
It starts, shows the homepage, but when I click on Admin Interface, blank screen on the /admin route and same error in the console (tried Edge and Firefox browsers, Windows 10, if that matters):

Uncaught TypeError: (0 , _reactRouterDom.withRouter) is not a function
    at Object.<anonymous> (index.js:300:39)
    at __webpack_require__ (index.js:21:30)
    at index.js:64:18
    at node_modules/react-router-navigation-prompt/es/index.js (index.js:65:10)
    at __require2 (chunk-FOWDQQBS.js?v=331060a4:19:50)
    at node_modules/payload/dist/admin/components/modals/LeaveWithoutSaving/index.js (index.tsx:2:34)
    at __require2 (chunk-FOWDQQBS.js?v=331060a4:19:50)
    at node_modules/payload/dist/admin/components/views/LivePreview/index.js (index.tsx:1:44)
    at __require2 (chunk-FOWDQQBS.js?v=331060a4:19:50)
    at node_modules/payload/dist/admin/components/views/Global/Routes/CustomComponent.js (CustomComponent.tsx:1:19)

The db docker container is correctly logging the connection, so that is not the problem.
What should I try?

@xHomu
Copy link
Collaborator

xHomu commented Feb 5, 2024

I was finally able to replicate the error with your exact setup (WIndows 10 / node 18.16 / npm install; npm run dev).

Instead of npm, can you delete package-lock.json and try using yarn install --frozen-lockfile; yarn dev instead?

If that works, that would help us narrow down the issue.

@marcob896
Copy link
Author

I was finally able to replicate the error with your exact setup (WIndows 10 / node 18.16 / npm install; npm run dev).

Instead of npm, can you delete package-lock.json and try using yarn install --frozen-lockfile; yarn dev instead?

If that works, that would help us narrow down the issue.

ok I did as you mentioned and it works.
I was finally able to start and go to the /admin route. I see the form to create the first payload user.
I see an error on the VSCode console though, if that could be useful:

Error: No route matches URL "/app.scss.map"
    at getInternalRouterError (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\router\router.ts:4496:5)
    at Object.query (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\router\router.ts:2935:19)
    at handleDocumentRequestRR (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\server-runtime\dist\server.js:182:35)
    at requestHandler (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\server-runtime\dist\server.js:107:24)
    at async C:\Users\marco\git\_vari\repay\node_modules\@remix-run\express\dist\server.js:41:22
No routes matched location "/app.scss.map" 
ErrorResponseImpl {
  status: 404,
  statusText: 'Not Found',
  internal: true,
  data: 'Error: No route matches URL "/app.scss.map"',
  error: Error: No route matches URL "/app.scss.map"
      at getInternalRouterError (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\router\router.ts:4496:5)
      at Object.query (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\router\router.ts:2935:19)
      at handleDocumentRequestRR (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\server-runtime\dist\server.js:182:35)
      at requestHandler (C:\Users\marco\git\_vari\repay\node_modules\@remix-run\server-runtime\dist\server.js:107:24)
      at async C:\Users\marco\git\_vari\repay\node_modules\@remix-run\express\dist\server.js:41:22
}
GET /app.scss.map 404 - - 118.465 ms

@xHomu
Copy link
Collaborator

xHomu commented Feb 6, 2024

Glad to hear that worked. When I have time, I'll have to dig a bit into why yarn works when npm didn't. I suspect there's some errant peer deps in payload that should get fixed.

@xHomu xHomu closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants