Build error while deploying app

Posted December 22, 2021 148 views
Node.jsDigitalOcean App PlatformNext.js

Just learning DigitalOceanApp platform and javascript. I’m using an existing open source library (SignalX) and hosting in DigitalOcean app. When it’s building, I see different errors which I don’t see locally. Any idea what the issue could be?
An example is

870:14  Error: Type string trivially inferred from a string literal, remove type annotation.  @typescript-eslint/no-inferrable-types
[kha-ching] [2021-12-22 18:47:26] 872:28  Warning: Missing return type on function.  @typescript-eslint/explicit-module-boundary-types

When I run locally using npm run build, I don’t see these errors.
I have resolved those, but wanted to see the errors locally itself so that I can resolve those. Thanks in advance

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @anilkuppa,

TypeScript has no type inference configuration.

How is your tslint.json configuration?

I think you need to set no-inferrable-types: false or add ignore-properties to its array.

In this link you have information about it:

Hope helps you,
Sergio Turpín

  • I don’t have tslint.json but I’ve .eslintrc.json file. Below are the rules:

    "rules": {
        "@typescript-eslint/explicit-function-return-type": "off",
        "@typescript-eslint/consistent-type-assertions": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "@typescript-eslint/strict-boolean-expressions": "off",
        "@typescript-eslint/no-floating-promises": "off",
        "@typescript-eslint/return-await": "off",
        "@next/next/no-html-link-for-pages": "off",
        "@next/next/no-img-element": "off"

    However, it’s building fine locally. Is there anyway we can get these errors locally? Does digitalOcean app platform use different lint rules?