Skip to content

npm start failing on newly created lb4 app #1405

Description

@tapas4java

Description / Steps to reproduce / Feature proposal

The app created following getting started guide is not in working state.

Current Behavior

Geting below exception when running npm start.

> lb-tsc

node_modules/@loopback/core/dist8/src/keys.d.ts:23:40 - error TS2307: Cannot find module '../../context/src/value-promise'.

23     const CONTROLLER_CLASS: BindingKey<import("../../context/src/value-promise").Constructor<any>>;
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


node_modules/@loopback/repository-json-schema/dist8/src/keys.d.ts:6:68 - error TS2307: Cannot find module '../../metadata/src/types'.

6 export declare const JSON_SCHEMA_KEY: MetadataAccessor<JSONSchema, import("../../metadata/src/types").DecoratorType>;

Expected Behavior

App should run without any issue

Activity

  1. raymondfeng commented on Jun 9, 2018

    @raymondfeng
    Contributor

    Hmm, it seems to be an issue related to TypeScript 2.9 (https://blogs.msdn.microsoft.com/typescript/2018/05/31/announcing-typescript-2-9/#import-types).

    Running npm run build for loopback-next/packages/context produces an invalid key.d.ts from src/key.ts:

    ...
    const CONTROLLER_CLASS: BindingKey<import("../../context/src/value-promise").Constructor<any>>;

    Please note the relative import is invalid outside the monorepo.

  2. raymondfeng commented on Jun 9, 2018

    @raymondfeng
    Contributor

    I'm proposing a workaround at #1406.

  3. raymondfeng commented on Jun 9, 2018

    @raymondfeng
    Contributor

    Please try npm i -g @loopback/[email protected]

  4. tapas4java commented on Jun 10, 2018

    @tapas4java
    Author

    Thanks @raymondfeng

    @loopback/[email protected] looks fine.

  5. reyalpsirc commented on Jul 26, 2018

    @reyalpsirc

    Its failing again on @loopback/[email protected] but with a different error now:

    screen shot 2018-07-26 at 11 54 02

  6. reyalpsirc commented on Jul 26, 2018

    @reyalpsirc

    Okay, just found out that it fails with node v8.2.1 but with node v8.3.0 it does work. Maybe the docs should actually refer that the minimum node version is 8.3.0?

  7. shimks commented on Jul 27, 2018

    @shimks
    Contributor

    I've been able to reproduce the problem.

    I see two options:

    • update our docs to have 8.3 and above
    • replace object spread operators with Object.assign

    What do you think @strongloop/sq-lb-apex, @bajtos, @raymondfeng?

  8. bajtos commented on Jul 30, 2018

    @bajtos
    Member

    Considering that Node.js 8.x LTS is at 8.11.3 now and 8.3.0 was released almost a year ago (2017-08-09) before 8.x entered LTS, I think it's acceptable to require our users to use 8.3.0 or newer.

    I am proposing to update our docs and mention 8.9.0 as the minimum required version (8.9.0 was the first 8.x version covered by LTS). As part of this change, we should also update all of our package.json files and modify engines section to use >=8.9 instead of current >=8 version spec for Node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions