Giter Site home page Giter Site logo

Comments (14)

capraynor avatar capraynor commented on August 20, 2024 1

Well I think we can do ln -s to link the /node_modules to network volume. Just a suggestion :-D .

Do you think this is possible? Is network volume contain some limitations?

from oryx.

capraynor avatar capraynor commented on August 20, 2024

Also reported in here.

projectkudu/kudu#2985

from oryx.

gpcastro avatar gpcastro commented on August 20, 2024

Thanks for reaching out. I can repro the issue, and we'll work on a fix. For now, disabling the performance optimizations we have for the build should make your build work. To do that, set app setting BUILD_FLAGS to "Off" (case matters, so "off" won't work"). Please let me know how it goes.

A bit of context as to why we compress node_modules: to make builds faster, we build the node_modules folder in a separate location in the container with faster disk IO, and copy its contents as node_modules.tar.gz to wwwroot, and extract its contents when running the app, also in a locatio with faster disk IO. For this app, the build is not copying the node_modules folder in a sub-directory as it should.

from oryx.

capraynor avatar capraynor commented on August 20, 2024

Hi, thanks for your information.

Seems that the BUILD_FLAGS works in my case.

But here's some other problems:

When BUILD_FLAGS is removed:

  • nodegit package can be installed normally
  • npm dedupe works correctly

When BUILD_FLAGS is Off:

  • nodegit package cannot be installed due to node-pre-gyp error.
  • npm dedupe has an error with npm ERR! Cannot read property '0' of undefined.

Seems that this is caused by different npm version.

I modified my code to let it works, but I think that the BUILD_FLAGS configuration should not affect npm version and node.js version.

Kudu separates the deploy environment and production environment.

I can tell that when we set BUILD_FLAGS to Off, Oryx will build all the things by using the node in production environment, I'm I correct?

from oryx.

capraynor avatar capraynor commented on August 20, 2024

Still have no idea about your flag. Your flag affects the node.js environment itself, let it not stable.

My Workaround:

I will run npm install, and move the node_modules to somewhere that oryx not discard.

And then, when the website starts, I will move that directory to node_modules. I will put this process to prestart phase.

This costs time when deploying, but works.

I will wait for your fix.

Thanks for your amazing product!

from oryx.

gpcastro avatar gpcastro commented on August 20, 2024

From your description, oryx might still be trying to extract node_modules when the app is starting. This will happen if oryx-manifest.toml file is present in /home/site/wwwroot. You can either remove this file, or just rebuild your application through app service (e.g. doing a git push or redeploying through VS Code)

from oryx.

capraynor avatar capraynor commented on August 20, 2024

Thanks for your reply

I did rm -fr * in /home/site/wwwroot/, things still happen. node-gyp won't work correctly.

from oryx.

capraynor avatar capraynor commented on August 20, 2024

npm dedupe is a known issue that never solved.

I think that the flag breaks the node.js version.

from oryx.

capraynor avatar capraynor commented on August 20, 2024

The node_modules will be extracted to /node_modules, is this the expected behavior?

The result is correct, but I think this is a little strange. If a user serves node_modules as a public directory, that user will get 404 when he requesting the files in node_modules.

from oryx.

gpcastro avatar gpcastro commented on August 20, 2024

Yes, this is expected. You can find out more about why we do this, as well as how to disable this behavior, here: https://github.com/microsoft/Oryx/blob/master/doc/hosts/appservice.md#nodejs

from oryx.

arroyc avatar arroyc commented on August 20, 2024

@capraynor we are doing this actually and it will be published in the next release. Thank you for the suggestion, we appreciate your feedback and please keep using the product and report any issues or suggestions that you may have. For the time being I'm closing the issue

from oryx.

capraynor avatar capraynor commented on August 20, 2024

Still not solved on azure app service.

from oryx.

kichalla avatar kichalla commented on August 20, 2024

@capraynor what is the issue that you are seeing? could you file a separate issue with more details?

from oryx.

capraynor avatar capraynor commented on August 20, 2024

#409

from oryx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.