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

PKG_VERSION is undefined in export.ts #7984

Closed
ggrossetie opened this issue May 4, 2024 · 1 comment · Fixed by #8016
Closed

PKG_VERSION is undefined in export.ts #7984

ggrossetie opened this issue May 4, 2024 · 1 comment · Fixed by #8016
Labels
bug Something isn't working

Comments

@ggrossetie
Copy link
Contributor

if (import.meta.env.VITE_IS_EXCALIDRAW_NPM_PACKAGE) {
assetPath =
window.EXCALIDRAW_ASSET_PATH ||
`https://unpkg.com/${import.meta.env.VITE_PKG_NAME}@${
import.meta.env.PKG_VERSION
}`;
if (assetPath?.startsWith("/")) {
assetPath = assetPath.replace("/", `${window.location.origin}/`);
}
assetPath = `${assetPath}/dist/excalidraw-assets/`;
}

The minified version is:

F=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/"
 .concat("@excalidraw/excalidraw","@")
 .concat({
  VITE_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",
  VITE_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",
  VITE_APP_LIBRARY_URL:"https://libraries.excalidraw.com/",
  VITE_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",
  VITE_APP_PORTAL_URL:"https://portal.excalidraw.com/",
  VITE_APP_PLUS_LP:"https://plus.excalidraw.com/",
  VITE_APP_PLUS_APP:"https://app.excalidraw.com/",
  VITE_APP_WS_SERVER_URL:"",
  VITE_APP_FIREBASE_CONFIG:'{
    "apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU",
    "authDomain":"excalidraw-room-persistence.firebaseapp.com",
    "databaseURL":"https://excalidraw-room-persistence.firebaseio.com/",
    "projectId":"excalidraw-room-persistence",
    "storageBucket":"excalidraw-room-persistence.appspot.com",
    "messagingSenderId":"654800341332",
   "appId":"1:654800341332:web:4a692de832b55bd57ce0c1"
  }',
  VITE_APP_DISABLE_TRACKING:"",
  VITE_PKG_NAME:"@excalidraw/excalidraw",
  VITE_PKG_VERSION:"0.17.3",
  VITE_IS_EXCALIDRAW_NPM_PACKAGE:!0
}.PKG_VERSION)

As you can see, VITE_PKG_VERSION is prefixed by VITE_. I can submit a pull request to replace PKG_VERSION by VITE_PKG_VERSION.

@Mrazator
Copy link
Collaborator

Mrazator commented May 7, 2024

As you can see, VITE_PKG_VERSION is prefixed by VITE_. I can submit a pull request to replace PKG_VERSION by VITE_PKG_VERSION.

Sure, let's do it!

ggrossetie added a commit to ggrossetie/excalidraw that referenced this issue May 13, 2024
The property name is `VITE_PKG_VERSION` (not `PKG_VERSION`)

Resolves excalidraw#7984
ad1992 pushed a commit that referenced this issue May 14, 2024
The property name is `VITE_PKG_VERSION` (not `PKG_VERSION`)

Resolves #7984
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants