Coder Social home page Coder Social logo

Cannot publish about hydrogen HOT 3 CLOSED

danabdn avatar danabdn commented on June 14, 2024
Cannot publish

from hydrogen.

Comments (3)

blittle avatar blittle commented on June 14, 2024

Hi Dan, the package.json file I don't think determines what version of Node is run within the action runner. Instead look inside your Github workflow yml file. For example, our workflow says the node version should come from .nvmrc

from hydrogen.

danabdn avatar danabdn commented on June 14, 2024

Hi Dan, the package.json file I don't think determines what version of Node is run within the action runner. Instead look inside your Github workflow yml file. For example, our workflow says the node version should come from .nvmrc

You're right @blittle - there is some sort of weird yml file thing with node 16 and yarn inside. But I have not the first idea how to edit such a document to e.g. use npm instead of yarn. Is there a way to via Shopify e.g. CLI to get this updated or do I need to learn about these files? How do I do it so I don't break the Oxygen server?

Do you know where on the Shopify (Hydrogen) website there exists documentation on this topic? I can't seem to find any which might suggest I shouldn't be touching it.

So - not sure if bug i.e. it should be automatically updated based on current package.json environment, that I need to run a safe CLI command to refresh or that everyone who uses Hydrogen at some point will be forced to start editing this file to make sure up to date e.g. expected version of node

Maybe I'll just upgrade the node version and see if that fixes things. Would be great if it used npm instead of yarn though.

Confusedly yours,
Dan.

from hydrogen.

danabdn avatar danabdn commented on June 14, 2024

Thanks again @blittle. Between your example and some help from a popular AI tool, it's now working.

To resolve...

  1. Changed the version of node from 16 to 18 (to match the one hydrogen uses). I'll take a look at nvmrc at a later date once I've obviously learned some more about CI & GitHub.
  2. To edit the yml file (in my case to move from a very old version of yarn to npm), this can be found in your project under the folder .github\workflows (easy to miss - I didn't realise it was even in my project). Update to use npm (ask ChatGPT to do this for you while checking the current version - edit sensibly). If you get an error about npm build, add npm run build instead.
  3. In GitHub Actions you can see your action success (or failure) results which gives details of any issues. Good error messages make it easy to diagnose issues.

Some documentation does exist and can be found here.

Action needed? Maybe consider adding to a troubleshooting page (add to failing oxygen deployments section) e.g. my project doesn't publish. Then describe how to access Github actions, check errors and give example of node version as a change. Perhaps with reasons why someone may wish to edit this file at all e.g. if it can do something helpful in common scenarios or might need to be updated periodically and if so what's likely needing to be updated.

Thanks,
Dan.

from hydrogen.

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.