market icon indicating copy to clipboard operation
market copied to clipboard

npm run serve not working as expected

Open htcarr3 opened this issue 3 years ago • 6 comments

Describe the bug

To Reproduce Clone the app npm run build npm run serve

Expected behavior I would expect this to point to the newly created ./out folder and serve the static content. Instead it points to public which is mostly empty.

Screenshots image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge
  • Version:

Additional context Maybe this comes from a misunderstanding of how nextjs projects are typically done, let me know if I am off base here. Are you expecting devs to copy over the content of that folder into ./public? I am happy to push up a pr for this.

htcarr3 avatar Aug 08 '22 22:08 htcarr3

We never use that so it's an old version. The correct way would probably be "serve": "next start", .

mihaisc avatar Aug 09 '22 06:08 mihaisc

next export && npm run serve should work, command was not updated when we moved from Gatsby to Next.js. Most likely we will remove this command

kremalicious avatar Aug 09 '22 10:08 kremalicious

"build:serve": "next export && next start",

Thoughts on this change? Also is there any interest in setting a ./.vscode/launch.json file with some default debug session configs?

{ "version": "0.2.0", "configurations": [ { "name": "Next.js: debug server-side", "type": "node-terminal", "request": "launch", "command": "npm run start" }, { "name": "Next.js: debug client-side", "type": "chrome", "request": "launch", "url": "http://localhost:8000" }, { "name": "Next.js: debug full stack", "type": "node-terminal", "request": "launch", "command": "npm run start", "serverReadyAction": { "pattern": "started server on .+, url: (https?://.+)", "uriFormat": "%s", "action": "debugWithChrome" } } ] }

htcarr3 avatar Aug 09 '22 12:08 htcarr3

Yeah, the deployment instructions also need updating in the docs as well. I'll handle that https://github.com/oceanprotocol/docs/issues/1084

jamiehewitt15 avatar Aug 10 '22 06:08 jamiehewitt15

@jamiehewitt15, I can close this if you are incorporating this in your issue, don't want to duplicate things.

htcarr3 avatar Aug 10 '22 14:08 htcarr3

The docs will have up to date instructions for a static deployment of the market when this is merged: https://github.com/oceanprotocol/docs/pull/1107

I've also added some links in the readme here to point people to the relevant guides in the docs: https://github.com/oceanprotocol/market/pull/1649

jamiehewitt15 avatar Aug 11 '22 14:08 jamiehewitt15