1

I'm trying to deploy an app that makes use of the MRE SDK to Heroku. As of this writing, the SDK itself is broken, and attempting to run an npm run build will result in an error.

A work around is to copy a modified animation.d.ts file over to the resulting node_modules folder, after the install (specifically ./node_modules/@microsoft/mixed-reality-extension-sdk/built/animation/).

I keep this file in a folder called v0.16_mre_fix.

Without this, the build will fail. So I added this to my package.json file.

"scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "clean": "tsc --build --clean",
        "heroku-postbuild": "cp -i ./v0.16_mre_fix/*.ts ./node_modules/@microsoft/mixed-reality-extension-sdk/built/animation/",
        "build": "tslint -p ./tsconfig.json src/**/*.ts && tsc --build",
        "lint": "tslint -p ./tsconfig.json src/**/*.ts",
        "start": "node .",
        "debug": "node --nolazy --inspect-brk=9229 ."
    },

According to heroku here, heroku-postbuild will be run after installing dependencies. This, however, did not work.

So I tried changing it to heroku-prebuild and postinstall:. They didn't work either.

Am I missing something?

EDIT: I also tried

"heroku-prebuild": "echo This runs before Heroku installs your dependencies.",

but I didn't see any echo in the ensuing git push.

6
  • 1
    You can try 'heroku-prebuild' Commented Apr 21, 2020 at 10:12
  • @SerdarSayın, I just did, though I'm not sure if the node_modules folder would exist by then, so I just added the sample code: "heroku-prebuild": "echo This runs before Heroku installs your dependencies.",. I didn't see any echo in the ensuing git push. Does this mean it failed? Commented Apr 21, 2020 at 10:15
  • Even though I suggested to you an option, you definitely shouldn't change your node_modules folder. If you think something's wrong with the package you should create an issue or PR. Commented Apr 21, 2020 at 10:24
  • That was actually their recommended course of action cause it's so broken LOL. I only really have to edit a certain line in the file animation.d.ts (remove a readonly that's causing issues). I just thought overwriting the file produced by node with a modified file would be easier. Commented Apr 21, 2020 at 10:27
  • 1
    Argh. That's rough. I strongly disagree with doing that but if that's the case, you can build that package on your local and use it from your local file instead of using it through node modules. I need to warn you once again it's really messy and discouraged. You shouldn't use it on production. Commented Apr 21, 2020 at 10:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.