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

[Bug]: Errors for "Invalid or unexpected token" & "countryService #10654

Open
aydinvivik opened this issue Dec 18, 2024 · 3 comments
Open

[Bug]: Errors for "Invalid or unexpected token" & "countryService #10654

aydinvivik opened this issue Dec 18, 2024 · 3 comments

Comments

@aydinvivik
Copy link

aydinvivik commented Dec 18, 2024

Package.json file

{
  "name": "medusa-starter-default",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "2.1.2",
    "@medusajs/cli": "2.1.2",
    "@medusajs/framework": "2.1.2",
    "@medusajs/medusa": "2.1.2",
    "@mikro-orm/core": "5.9.7",
    "@mikro-orm/knex": "5.9.7",
    "@mikro-orm/migrations": "5.9.7",
    "@mikro-orm/postgresql": "5.9.7",
    "awilix": "^8.0.1",
    "pg": "^8.13.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "2.1.2",
    "@mikro-orm/cli": "5.9.7",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v22.12.0

Database and its version

PostgreSQL 17.0

Operating system name and version

MacOS Sequoia

Browser name

Chrome

What happended?

I installed medusa as stated in the documentation, when I try to run it with the “npm run dev” command I get errors and can't proceed. I deleted the “node_modules” folder and reinstalled it, but the problem persists.

Error on first installation;
An error occurred while preparing project: Error: Command failed: npx medusa user -e [email protected] --invite Error: Loaders for module Region failed: Could not resolve 'countryService'.

Error with “npm run dev” command;
Invalid or unexpected token: at Object.require.extensions.<computed> [as .js] (/**/**/**/medusa-backend/node_modules/ts-node/src/index.ts:1608:43)
error: Could not resolve module: Region. Error: Loaders for module Region failed: Could not resolve 'countryService'.

Expected behavior

It should work with the “npm run dev” command.

Actual behavior

.

Link to reproduction repo

https://github.com/aydinvivik/medusa-backend.git

@fPolic
Copy link
Contributor

fPolic commented Dec 18, 2024

hey @aydinvivik, I couldn't reproduce that on my end. Were there any additional errors when you ran npx create-medusa-app@latest?

@aydinvivik
Copy link
Author

aydinvivik commented Dec 18, 2024

hey @aydinvivik, I couldn't reproduce that on my end. Were there any additional errors when you ran npx create-medusa-app@latest?

Hi @fPolic , when I ran npx create-medusa-app@latest it didn't give any error but later it gave error.

Screenshot 2024-12-18 at 23 39 17

@aydinvivik
Copy link
Author

I guess I won't find a solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants