expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
852 stars 86 forks source link

Error: EINVALIDTAGNAME Tags may not have any characters that encodeURIComponent encodes. #2467

Closed Ramon-Balaguer closed 2 months ago

Ramon-Balaguer commented 4 months ago

Build/Submit details page URL

No response

Summary

I try to use docker to execute: npx eas build --platform android --local --profile production

My docker file:

FROM node:20.15

ARG NODE_ENV=production
ENV NODE_ENV=$NODE_ENV
ENV EXPO_TOKEN=token

ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=/home/node/.npm-global/bin:$PATH
RUN npm i -g expo-cli eas-cli expo-doctor npx

RUN mkdir /opt/app
WORKDIR /opt/app
ENV PATH=/opt/app/.bin:$PATH
COPY ./package.json ./package-lock.json ./
RUN npm install

WORKDIR /opt/app
COPY . .

RUN npx expo prebuild  
RUN npx expo-doctor
RUN git init
RUN npx eas build --platform android --local --profile production

All works good but when script try to execute last RUN

Managed or bare?

bare

Environment

RUN npx expo prebuild
RUN npx expo-doctor RUN git init RUN npx eas build --platform android --local --profile production

Error output

 > [12/12] RUN npx eas build --platform android --local --profile production:
1.734 Loaded "env" configuration for the "production" profile: no environment variables specified. Learn more: https://docs.expo.dev/build-reference/variables/
2.202 Specified value for "android.package" in app.json is ignored because an android directory was detected in the project.
2.202 EAS Build will use the value found in the native code.
2.219 ✔ Using remote Android credentials (Expo server)
2.452 ✔ Using Keystore from configuration: Build Credentials qutXCRnBnE (default)
3.560 - Compressing project files
4.830 /home/node/.npm-global/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:296
4.830       throw invalidTagName(spec)
4.830       ^
4.830
4.830 Error: Invalid tag name "eyJqb2IiOns...IiOmZhbHNlfX0=": Tags may not have any characters that encodeURIComponent encodes.
4.830     at invalidTagName (/home/node/.npm-global/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:91:15)
4.830     at fromRegistry (/home/node/.npm-global/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:296:13)
4.830     at resolve (/home/node/.npm-global/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:81:12)
4.830     at npa (/home/node/.npm-global/lib/node_modules/npx/node_modules/npm-package-arg/npa.js:52:10)
4.830     at Function.parseArgs (/home/node/.npm-global/lib/node_modules/npx/node_modules/libnpx/parse-args.js:48:23)
4.830     at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/npx/index.js:8:20)
4.830     at Module._compile (node:internal/modules/cjs/loader:1358:14)
4.830     at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
4.830     at Module.load (node:internal/modules/cjs/loader:1208:32)
4.830     at Module._load (node:internal/modules/cjs/loader:1024:12) {
4.830   code: 'EINVALIDTAGNAME'
4.830 }
4.830
4.830 Node.js v20.15.1
4.834 npx exited with non-zero code: 1
4.838     Error: build command failed.

Reproducible demo or steps to reproduce from a blank project

docker build -t project . docker run project

Ramon-Balaguer commented 4 months ago
{
  "name": "XXXXXX",
  "version": "1.0.0",
  "main": "expo/AppEntry.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "lint": "eslint ."
  },
  "dependencies": {
    "@expo/metro-runtime": "~3.2.1",
    "@gluestack-style/react": "^1.0.56",
    "@gluestack-ui/config": "^1.1.18",
    "@gluestack-ui/themed": "^1.1.31",
    "@gorhom/bottom-sheet": "^5.0.0-alpha.10",
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-navigation/drawer": "^6.6.15",
    "@react-navigation/native-stack": "^6.10.0",
    "dotenv": "^16.4.5",
    "expo": "~51.0.22",
    "expo-auth-session": "^5.5.2",
    "expo-crypto": "^13.0.2",
    "expo-dev-client": "~4.0.20",
    "expo-linking": "^6.3.1",
    "expo-secure-store": "~13.0.2",
    "expo-status-bar": "~1.12.1",
    "expo-web-browser": "^13.0.3",
    "jwt-decode": "^4.0.0",
    "neumorphic-tab": "^1.0.2",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.74.3",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-paper": "^5.12.3",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.5",
    "react-native-screens": "3.31.1",
    "react-native-svg": "15.2.0",
    "react-native-vector-icons": "^10.1.0",
    "react-native-video": "github:Ramon-Balaguer/react-native-video",
    "react-native-web": "~0.19.10"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@expo/config-plugins": "~8.0.0",
    "@expo/prebuild-config": "^7.0.7",
    "@types/react": "~18.2.79",
    "@types/react-native-vector-icons": "^6.4.18",
    "eslint": "^8.57.0",
    "eslint-config-expo": "^7.0.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "prettier": "^3.3.2",
    "typescript": "~5.3.3"
  },
  "private": true
}
szdziedzic commented 4 months ago

I'm wondering how the RUN npx eas build --platform android --local --profile production call worked for you 🤔. What I mean by this is that you are calling the eas package here and not eas-cli. The eas package is not associated with Expo and EAS CLI. The correct way to use EAS CLI through the npx is to do npx -y eas-cli@latest ... instead of npx eas ....

You shouldn't install Expo CLI globally anymore, it's shipped with an expo package (you can call it as npx expo ...) and you are using both eas-cli and expo-doctor through npx anyway so this line can be changed to: npm i -g expo-cli eas-cli expo-doctor npx -> npm i -g npx or even deleted if npx is shipped in the base image by default.

I believe that COPY . . instruction will copy all files and directories from the current directory on the host machine into the current working directory in the Docker image. It means it will also copy your node_modules if not dockerignored and it might be problematic. Do you have node_modules dockerignored?

ENV EXPO_TOKEN - I hope this wasn't your real token. If it was please disable it.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 30 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.