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

Azure build pipeline issues. #1214

Closed
hyunoosung opened this issue Mar 18, 2020 · 4 comments
Closed

Azure build pipeline issues. #1214

hyunoosung opened this issue Mar 18, 2020 · 4 comments

Comments

@hyunoosung
Copy link

  1. With Azure DevOps pipeline, the process.env.PORT is locked at port 3000 which generates 3e3 hex value in server.js.

  2. Once deployed, homepage generates below error.
    Error: EINVAL: invalid argument, stat '/home/site/wwwroot/D:\a\1\s\build\public/index.html'

I have applied work around in #906 but the best result so far is as below.
.use(o.a.static("D:\a\1\s\build\public"))

"D:\a\1\s\build\public" directory is where Azure devOps CI uses for build pipeline.

#1 can be resolved by just manually setting const port = 8080 since Azure WebApp uses 8080 port.
#2 I can only resolve this by using VSCode Azure App Service extension and manually change .use(o.a.static("D:\a\1\s\build\public")) to .use(o.a.static("build/public"))

Can anyone help to fix this build issue or point out where to look at?

@cloudhospital
Copy link

cloudhospital commented Mar 18, 2020

Got workaround of 2.
Changed
.use(express.static(process.env.RAZZLE_PUBLIC_DIR!))
to .use(express.static('build/public'))

and the built server.js now has
use(o.a.static("build/public"))

But I'm sure there should be definitely better approach with modifying RAZZLE_PUBLIC_DIR.

@nimaa77
Copy link
Collaborator

nimaa77 commented Mar 18, 2020

hello, what is the problem?
is that something about environment variables?
maybe this helps you https://github.com/jaredpalmer/razzle#runtime-variables

I'm living in a country that can't use Azure or AWS because of USA sanctions so I have no experience with azure

if you explain the problem more maybe I can help you with it

@hyunoosung
Copy link
Author

It was process.env.RAZZLE_PUBLIC_DIR.
Azure DevOps CI pipeline build and drop artifact in vm which has physical address like I shared ex) D:/a/1/s/something...
Then Razzle build take this physical address into server.js and generates 'wwwroot/D:\a\1\s\build\public' for public dir.
where Azure web app just need public folder name as relative path for example 'build/public'
So I had to hardcord Server.ts as below.

.use(express.static('build/public'))

@fivethreeo
Copy link
Collaborator

RAZZLE_PUBLIC_DIR is now relative in canary release

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

4 participants