TS2688: Cannot find type definition file for 'express-unless' moralis parse server

Trying to deploy my parse server to heroku and I am getting an error

remote:        error TS2688: Cannot find type definition file for 'express-unless'.
remote:          The file is in the program because:
remote:            Entry point for implicit type library 'express-unless'
remote: error Command failed with exit code 2.
remote:        info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any idea what is going wrong here? I have tried deleting the “express-unless” folder from node_modules

Hey @tgn

Deleting node_modules folder locally usually won’t affect what is deployed in Heroku as node_modules are usually generated in the server before deployed live

From your errors, look like you shouldn’t delete but actually add express-unless as an additional dependency :raised_hands: try npm install express-unless to your project

1 Like

Thanks! I tried this, and am now getting another error

remote:        error Command failed.
remote:        Exit code: 128
remote:        Command: git
remote:        Arguments: ls-remote --tags --heads ssh://[email protected]/mongodb-js/mongodb-tools.git
remote:        Directory: /tmp/build_b762fb43
remote:        Output:
remote:        Host key verification failed.
remote:        fatal: Could not read from remote repository.
remote:

along with this error

remote:  !     Push rejected, failed to compile Node.js app.
remote:
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 58f8122557c80ca4f5a7496ccd69b5ebe0c0b50b
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 58f8122557c80ca4f5a7496ccd69b5ebe0c0b50b
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:

Ohhh what did you do again to this error? :thinking: looks like it is related to deployment or pushing to GitHub

1 Like

I’m trying to deploy a moralis parse server to heroku. Not sure what is happening here.

Looks like it’s related to your access to Heroku since your push from GitHub is being rejected by Heroku

1 Like

Still getting issues when deploying our parse server to heroku. I have tried making a new github repo, and still get issues.

remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.22.19
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: warning Pattern ["debug@>= 2.6.9 < 3.0.0 || >= ^3.1.0"] is trying to unpack in the same destination "/tmp/yarncache.XUWas/v6/npm-debug-3.2.7-integrity/node_modules/debug" as pattern ["debug@^3.1.0","debug@^3.2.7","debug@^3.2.7"]. This could result in non-deterministic behavior, skipping.
remote: error Command failed.
remote: Exit code: 128
remote: Command: git
remote: Arguments: ls-remote --tags --heads ssh://[email protected]/mongodb-js/mongodb-tools.git
remote: Directory: /tmp/build_9949dfda
remote: Output:
remote: Host key verification failed.
remote: fatal: Could not read from remote repository.
remote:
remote: Please make sure you have the correct access rights
remote: and the repository exists.
remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - node_modules checked into source control
remote: https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:

It looks like it can not access a repository

1 Like

Any idea what the possible issues with the repository could be? Would making a new github account + repository make sense?

It could be from a dependency. Does it work locally?

1 Like

Yes everything works locally. we just get this error when deploying.

Could you deploy somehow with more debug logging?

1 Like

I tried a manual deploy from the github branch and still getting this

-----> Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       USE_YARN_CACHE=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       engines.yarn (package.json):  unspecified (use default)
       
       Resolving node version 18.x...
       Downloading and installing node 18.13.0...
       Using default npm version: 8.19.3
       Resolving yarn version 1.22.x...
       Downloading and installing yarn (1.22.19)
       Installed yarn 1.22.19
        !     node_modules checked into source control
              https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
       
       
-----> Installing dependencies
       Installing node modules (yarn.lock)
       yarn install v1.22.19
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       warning Pattern ["debug@>= 2.6.9 < 3.0.0 || >= ^3.1.0"] is trying to unpack in the same destination "/tmp/yarncache.WwLnm/v6/npm-debug-3.2.7-integrity/node_modules/debug" as pattern ["debug@^3.1.0","debug@^3.2.7","debug@^3.2.7"]. This could result in non-deterministic behavior, skipping.
       error Command failed.
       Exit code: 128
       Command: git
       Arguments: ls-remote --tags --heads ssh://[email protected]/mongodb-js/mongodb-tools.git
       Directory: /tmp/build_2bb09fb7
       Output:
       Host key verification failed.
       fatal: Could not read from remote repository.

This seems to be the repository.

Maybe you could change the link to not use ssh and use https

1 Like

Okay, I apologize for my lack of understanding here, where would I change that link?

Maybe is easier to fix fix error, try to search on google this error and the service where you try to deploy.

1 Like

It may not be easy to do that. You will have to change in the dependencies list

1 Like