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

npm run dev does not respect --reset parameter #3870

Closed
2 tasks
alexanderhupfer opened this issue May 8, 2024 · 3 comments
Closed
2 tasks

npm run dev does not respect --reset parameter #3870

alexanderhupfer opened this issue May 8, 2024 · 3 comments

Comments

@alexanderhupfer
Copy link

Issue summary

Before opening this issue, I have:

  • [ x ] Upgraded to the latest version of the @shopify packages

    • Affected @shopify/shopify-* package and version:
      "@remix-run/node": "^2.8.1",
      "@remix-run/react": "^2.8.1",
      "@remix-run/serve": "^2.8.1",
      "@shopify/app": "3.57.1",
      "@shopify/app-bridge-react": "^4.1.2",
      "@shopify/app-bridge-types": "^0.0.10",
      "@shopify/cli": "^3.60.0",
      "@shopify/polaris": "^12.22.1",
      "@shopify/shopify-api": "^9.5.1",
      "@shopify/shopify-app-remix": "^2.7.0",
      "@shopify/shopify-app-session-storage-prisma": "^4.0.2",

    • Node version:
      v22.1.0

    • Operating system:
      Mac OS 14.4.1 (23E224)

  • Set { logger: { level: LogSeverity.Debug } } in my configuration

  • [ x ] Found a reliable way to reproduce the problem that indicates it's a problem with the package

  • [ x ] Looked for similar issues in this repository

  • Checked that this isn't an issue with a Shopify API

Expected behavior

What do you think should happen?

App configuration should be reset

Actual behavior

Starting the app fails with message to invoke reset

Steps to reproduce the problem

npm run dev -- --reset

Debug logs

% npm run dev -- --reset

> predev
> prisma generate && prisma migrate deploy

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (v5.11.0) to ./node_modules/@prisma/client in 78ms

...

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "syncmatic" at "localhost:3306"

18 migrations found in prisma/migrations


No pending migrations to apply.

> dev
> shopify app dev --reset


│  The flag `api-key` has been deprecated in favor of `client-id` 


?  Which organization is this work for?
✔  my organisation

error 
Couldn't find the app with Client ID `42xxxxxxxxxxxxxxxxxxxxxxxxxx1 # My App`
You can pass `--reset` to your command to reset your app configuration. 


@alexanderhupfer alexanderhupfer changed the title CLI does not respect --reset parameter npm run dev does not respect --reset parameter May 8, 2024
@alexanderhupfer
Copy link
Author

Update: this worked again after downgrading to node 21

@lizkenyon
Copy link
Contributor

Hi there 👋
I am going to transfer this ticket over to the CLI repository.

@lizkenyon lizkenyon transferred this issue from Shopify/shopify-app-template-remix May 8, 2024
@isaacroldan
Copy link
Contributor

Hi @alexanderhupfer, seems like you have a environment variable that is overriding the api-key value.
Somewhere in your system you have SHOPIFY_FLAG_APP_API_KEY=42xxxxxxxxxxxxxxxxxxxxxxxxxx1

when you use --reset we ignore any cached value, but if you provide an api_key via env var, it will take precedence.
In other words, you are both ignoring cached values and setting a new one in the some command.

Just remove the environment variable and --reset will work again :)

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

3 participants