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

Not sure how to deploy #29

Open
Kcin1993 opened this issue Jul 13, 2023 · 5 comments
Open

Not sure how to deploy #29

Kcin1993 opened this issue Jul 13, 2023 · 5 comments
Labels
question Further information is requested

Comments

@Kcin1993
Copy link

Does "serve": "cross-env NODE_ENV=production node index.ts" cmd can be work on the host like Heroku? The web server couldn't read the ts file.

The error log shown on Heroku is TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/index.ts

Because I use the Shopify Cli first then check this repo's relative configuration to setup the typescript on my app, so I'm not sure that did I miss any part about typescript compile setting. Should we add the "postinstall": "tsc" to produce the index.js file? Something like this

"serve": "cross-env NODE_ENV=production node index.js",
"postinstall": "tsc"
@tomoyanakano tomoyanakano added the question Further information is requested label Jul 17, 2023
@DanhHoaDev
Copy link

same question here

@tomoyanakano
Copy link
Owner

tomoyanakano commented Aug 2, 2023

HI there.
Thank you for submitting issue.
As @Kcin1993 mentioned, Heroku cannot read .ts extension file. I'm trying to find the way to deploy the app to Heroku and I think it's required to compiled to .js and serve it.

Please wait a moment for fixing and finding the way of it.

(I always use this template with fly.io or gcp cloud run and works correctly. if you would like to use it soon, please considering to use these services)

@kaaancan
Copy link

kaaancan commented Sep 3, 2023

Hey guys, i found a way. Just compile the ts to js.

In web/package.json add the following two commands:

"build": "tsc",

"serve": "cross-env NODE_ENV=production node index.js"

Also you need to read the environment variables to shopify.ts like this:

apiSecretKey: process.env.SHOPIFY_API_SECRET, //Here your backend domain url hostName: "https://localhost:3000", apiKey: process.env.SHOPIFY_API_KEY,

If you run npm:serve dont forget to set your environement variables.

@schnitzel112
Copy link

(I always use this template with fly.io or gcp cloud run and works correctly. if you would like to use it soon, please considering to use these services)

how do you deploy it to gcp cloud run? The Dockerfile with the package.json from this repo fails too:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /app/index.ts

@kaaancan
Copy link

kaaancan commented Sep 9, 2023

@schnitzel112

I did not work with gcp before , i am using railway.app which reads the dockerfile and builds and shipes a container.

Are you not using the dockerfile ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants