remix-pwa: Error on init

When I use npx remix-pwa@latest init it show the following message, after I choose the options: No remix.config.js file found in your project. Please make sure to run in a remix project or create one and try again or alternatively, run remix-pwa --help for more info.

The project is a remix app, it has a remix.config.js, that’s on the root directory and I choose the app directory (default).

I just cant figure a way to implement push notifications properly on my remix app.

The project: https://github.com/JamesBrandts/easyschedule

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 1
  • Comments: 32 (18 by maintainers)

Most upvoted comments

Noted 👍. Would make required changes later on, thanks for the heads up

@ShafSpecs appreciate all your effort on this project, this is all very promising!

I mean misleading here: image

It’s not single step to start a new project, it’s two steps: npx init remix (or whatever), then npx init remix-pwa

I think it’s also important to note somewhere on the docs (Installation) which remix versions are supported (1 and 2?) and in case, whether any remix v2 feature flags have an impact here (supported or not).

@ShafSpecs here’s a demo of the issue on two platforms (Mac + Node 18 and Debian + Node20): https://d.pr/v/Ty5zhc

OMG, just re-read the whole thread here:

Because it is meant to run on an already working Remix application.

NOT CLEAR AT ALL FROM THE DOCS : ( remix-pwa homepage is very misleading too… trying that now but it leaves me wondering what the compatibility is like in terms of remix versions too.

Because it is meant to run on an already working Remix application.

I may sound stupid, but I didn’t know until I saw the message No remix.config.js file found in your project because the installation docs is not clear about it.

So, I just copied and pasted remix.config.js out of curiosity, and then I got the ENOENT error.

As you said, ENOENT errors should not occur in a normal remix project, but I thought that there might be cases where the app or app/routes directories do not exist.

It’s not a serious issue, so you can just ignore it. 😅

One thing I forgot to note (not that it matters anymore), but if the user entered a wrong appDirectory, there was a validation function that alongs the line of:

validate(input: string) {
  if (input === '') {
    return 'Please enter a valid directory';
  }

  pathExists(resolve(projectDir, input)).then(exists => {
    if (!exists) {
      return 'Please enter a valid directory';
    }
  });

  return true;
}

But I decided to read the remix.config instead and skip that part entirely

The error reads: PS G:\Github\remix-pwa test> npx remix-pwa@3.0.9 This command is getting deprecated soon. Please use npx remix-pwa@latest init instead. √ Is this a TypeScript or JavaScript project? Pick the opposite for chaos! · ts √ Do you want to integrate workbox into your project? (y/N) · false √ Do you want to utilise precaching in this project? (y/N) · false √ What features of remix-pwa do you need? Don’t be afraid to pick all! · sw, manifest √ Where is your Remix app directory located? · app √ What package manager do you use? · npm √ Do you want to run npm install? (Y/n) · true ⠋ Integrating Service Worker… ⠋ Integrating Web Manifest… ✔ Successfully ran npm install! ⠙ Integrating Web Manifest… [Error: ENOENT: no such file or directory, open ‘G:\G:\Github\remix-pwa%20test\app\routes\manifest[.]webmanifest.ts’] { errno: -4058, code: ‘ENOENT’, syscall: ‘open’, path: ‘G:\G:\Github\remix-pwa%20test\app\routes\manifest[.]webmanifest.ts’ } [Error: ENOENT: no such file or directory, open ‘G:\G:\Github\remix-pwa%20test\app\entry.worker.ts’] { errno: -4058, code: ‘ENOENT’, syscall: ‘open’, path: ‘G:\G:\Github\remix-pwa%20test\app\entry.worker.ts’ ⠋ Integrating Web Manifest… ⠼ Integrating Service Worker…

This error occurs when there are no /app or /app/routes directories. If the directories exist, and entry.worker or manifest doesn’t exist, the default files are copied into those directories.

More appropriate error messages would be helpful.

I think i have spotted the cause for the error 👍, the CLI is trying to read the files before writing to them

The error reads:

PS G:\Github\remix-pwa test> npx remix-pwa@3.0.9 This command is getting deprecated soon. Please use npx remix-pwa@latest init instead. √ Is this a TypeScript or JavaScript project? Pick the opposite for chaos! · ts √ Do you want to integrate workbox into your project? (y/N) · false √ Do you want to utilise precaching in this project? (y/N) · false √ What features of remix-pwa do you need? Don’t be afraid to pick all! · sw, manifest √ Where is your Remix app directory located? · app √ What package manager do you use? · npm √ Do you want to run npm install? (Y/n) · true ⠋ Integrating Service Worker… ⠋ Integrating Web Manifest… ✔ Successfully ran npm install! ⠙ Integrating Web Manifest… [Error: ENOENT: no such file or directory, open ‘G:\G:\Github\remix-pwa%20test\app\routes\manifest[.]webmanifest.ts’] { errno: -4058, code: ‘ENOENT’, syscall: ‘open’, path: ‘G:\G:\Github\remix-pwa%20test\app\routes\manifest[.]webmanifest.ts’ } [Error: ENOENT: no such file or directory, open ‘G:\G:\Github\remix-pwa%20test\app\entry.worker.ts’] { errno: -4058, code: ‘ENOENT’, syscall: ‘open’, path: ‘G:\G:\Github\remix-pwa%20test\app\entry.worker.ts’ ⠋ Integrating Web Manifest…

⠼ Integrating Service Worker…

This error occurs when there are no /app or /app/routes directories. If the directories exist, and entry.worker or manifest doesn’t exist, the default files are copied into those directories.

More appropriate error messages would be helpful.

Now it completes the installation perfectly on codespace, on windows I still get this error, but it’s doesn’t seem to be a big deal, as it seems to be a windows only problem, I can create those files manually or push them from a codespace. Thanks for the help.

Error REMIX-PWA 3

For the npx remix-pwa@dev init, in all environments, I get the following error:

npm ERR! code ETARGET npm ERR! notarget No matching version found for remix-pwa@dev. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn’t exist.

npm ERR! A complete log of this run can be found in: /home/codespace/.npm/_logs/2023-09-22T20_51_07_390Z-debug-0.log

Error REMIX-PWA 2 2023-09-22T20_51_07_390Z-debug-0.log

Tried it again on my project in windows, tried creating a new remix project from scratch, on windows 10 and on codespace I get the error: $ npx remix-pwa@latest init Need to install the following packages: remix-pwa@3.0.8 Ok to proceed? (y) y node:internal/errors:496 ErrorCaptureStackTrace(err); ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package ‘@remix-run/dev’ imported from /home/codespace/.npm/_npx/2a790d8a53532af9/node_modules/@remix-pwa/dev/dist/compiler/compiler.js at new NodeError (node:internal/errors:405:5) at packageResolve (node:internal/modules/esm/resolve:780:9) at moduleResolve (node:internal/modules/esm/resolve:829:20) at defaultResolve (node:internal/modules/esm/resolve:1034:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:375:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:344:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:220:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39) at link (node:internal/modules/esm/module_job:84:36) { code: ‘ERR_MODULE_NOT_FOUND’ }

Node.js v20.6.1 Error REMIX-PWA

Just tried install it on a codespace and it installed correctly, I must have something weird in my local system.

Please what Operating System do you use locally?

Locally I’m using Windows 10

Just tried install it on a codespace and it installed correctly, I must have something weird in my local system. Perhaps some incompatible version on a dependency. Hope when I merge it to main everything work fine. Thank you

Hello 👋, thanks for reaching out. This is very weird bug indeed, can you please re-try and post a screenshot of the console (if possible?)