Skip to content

App inside another project doesn't work #10

@FrancescoSaverioZuppichini

Description

I have a normal node/bun project, inside I've created a folder functions and run exactly what is in the doc

azd init --template functions-quickstart-typescript-azd -e flexquickstart-ts
npm install
npm start

However, it explodes

 functions git:(feature/coversion-to-dynamodb) ✗ npm start   

> prestart
> npm run clean && npm run build


> clean
> rimraf dist


> build
> tsc

node_modules/typescript/lib/lib.dom.d.ts:17429:15 - error TS2430: Interface 'WebAssembly.GlobalDescriptor<T>' incorrectly extends interface 'Bun.WebAssembly.GlobalDescriptor<T>'.
  Types of property 'value' are incompatible.
    Type 'ValueType' is not assignable to type 'T'.
      'ValueType' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'keyof ValueTypeMap'.
        Type '"anyfunc"' is not assignable to type 'T'.
          '"anyfunc"' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'keyof ValueTypeMap'.

17429     interface GlobalDescriptor {
                    ~~~~~~~~~~~~~~~~

../node_modules/bun-types/bun.d.ts:20:7 - error TS2315: Type 'TypedArray' is not generic.

20     | NodeJS.TypedArray<TArrayBuffer>
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/bun-types/bun.d.ts:21:7 - error TS2315: Type 'DataView' is not generic.

21     | DataView<TArrayBuffer>;
         ~~~~~~~~~~~~~~~~~~~~~~

../node_modules/bun-types/bun.d.ts:3729:40 - error TS2344: Type 'R' does not satisfy the constraint '{ [K in keyof R]: RouteValue<Extract<K, string>>; }'.
  Type '{ [K in keyof R]: RouteValue<K & string>; }' is not assignable to type '{ [K in keyof R]: RouteValue<Extract<K, string>>; }'.
    Type 'RouteValue<K & string>' is not assignable to type 'RouteValue<Extract<K, string>>'.
      Type 'RouteHandler<K & string>' is not assignable to type 'RouteValue<Extract<K, string>>'.
        Type 'RouteHandler<K & string>' is not assignable to type 'RouteHandler<Extract<K, string>>'.
          Types of parameters 'req' and 'req' are incompatible.
            Type 'BunRequest<Extract<K, string>>' is not assignable to type 'BunRequest<K & string>'.
              Types of property 'params' are incompatible.
                Type 'ExtractRouteParams<Extract<K, string>>' is not assignable to type 'ExtractRouteParams<K & string>'.
                  Type '{ [x: string]: string; } | (Extract<K, string> extends `${string}:${infer Param}` ? { [K in Param]: string; } : Extract<K, string> extends `${string}*` ? {} : {})' is not assignable to type 'ExtractRouteParams<K & string>'.
                    Type '{ [x: string]: string; }' is not assignable to type 'ExtractRouteParams<K & string>'.
                      Type '{ [K in `${Param}`]: string; } & ExtractRouteParams<`${Rest}`>' is not assignable to type '{ [K in Param]: string; } & ExtractRouteParams<Rest>'.
                        Type '{ [K in `${Param}`]: string; } & ExtractRouteParams<`${Rest}`>' is not assignable to type '{ [K in Param]: string; }'.

3729       options: ServeFunctionOptions<T, R> & {
                                            ~

../node_modules/bun-types/bun.d.ts:4158:38 - error TS2344: Type 'R' does not satisfy the constraint '{ [K in keyof R]: RouteValue<Extract<K, string>>; }'.
  Type '{ [K in keyof R]: RouteValue<K & string>; }' is not assignable to type '{ [K in keyof R]: RouteValue<Extract<K, string>>; }'.
    Type 'RouteValue<K & string>' is not assignable to type 'RouteValue<Extract<K, string>>'.
      Type 'RouteHandler<K & string>' is not assignable to type 'RouteValue<Extract<K, string>>'.
        Type 'RouteHandler<K & string>' is not assignable to type 'RouteHandler<Extract<K, string>>'.
          Types of parameters 'req' and 'req' are incompatible.
            Type 'BunRequest<Extract<K, string>>' is not assignable to type 'BunRequest<K & string>'.
              Types of property 'params' are incompatible.
                Type 'ExtractRouteParams<Extract<K, string>>' is not assignable to type 'ExtractRouteParams<K & string>'.
                  Type '{ [x: string]: string; } | (Extract<K, string> extends `${string}:${infer Param}` ? { [K in Param]: string; } : Extract<K, string> extends `${string}*` ? {} : {})' is not assignable to type 'ExtractRouteParams<K & string>'.
                    Type '{ [x: string]: string; }' is not assignable to type 'ExtractRouteParams<K & string>'.
                      Type '{ [K in `${Param}`]: string; } & ExtractRouteParams<`${Rest}`>' is not assignable to type '{ [K in Param]: string; } & ExtractRouteParams<Rest>'.

4158     options: ServeFunctionOptions<T, R> & {
                                          ~

../node_modules/bun-types/bun.ns.d.ts:4:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

4   export import Bun = BunModule;
    ~~~~~~

../node_modules/bun-types/globals.d.ts:237:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Event' must be of type '{ new (type: string, eventInitDict?: EventInit): Event; prototype: Event; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; readonly NONE: number; }', but here has type '{ new (type: string, eventInitDict?: EventInit): Event; prototype: Event; readonly NONE: 0; readonly CAPTURING_PHASE: 1; readonly AT_TARGET: 2; readonly BUBBLING_PHASE: 3; }'.

237 declare var Event: {
                ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5227:13
    5227 declare var Event: {
                     ~~~~~
    'Event' was also declared here.

../node_modules/bun-types/globals.d.ts:698:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'closed' must be of type 'Promise<undefined>', but here has type 'Promise<void>'.

698   readonly closed: Promise<void>;
               ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:11671:14
    11671     readonly closed: Promise<undefined>;
                       ~~~~~~
    'closed' was also declared here.

../node_modules/bun-types/globals.d.ts:733:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'closed' must be of type 'Promise<undefined>', but here has type 'Promise<void>'.

733   readonly closed: Promise<void>;
               ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17051:14
    17051     readonly closed: Promise<undefined>;
                       ~~~~~~
    'closed' was also declared here.

../node_modules/bun-types/globals.d.ts:735:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'ready' must be of type 'Promise<undefined>', but here has type 'Promise<void>'.

735   readonly ready: Promise<void>;
               ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17053:14
    17053     readonly ready: Promise<undefined>;
                       ~~~~~
    'ready' was also declared here.

../node_modules/bun-types/globals.d.ts:839:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INDEX_SIZE_ERR' must be of type 'number', but here has type '1'.

839   readonly INDEX_SIZE_ERR: 1;
               ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3925:14
    3925     readonly INDEX_SIZE_ERR: number;
                      ~~~~~~~~~~~~~~
    'INDEX_SIZE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:840:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'DOMSTRING_SIZE_ERR' must be of type 'number', but here has type '2'.

840   readonly DOMSTRING_SIZE_ERR: 2;
               ~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3923:14
    3923     readonly DOMSTRING_SIZE_ERR: number;
                      ~~~~~~~~~~~~~~~~~~
    'DOMSTRING_SIZE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:841:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'HIERARCHY_REQUEST_ERR' must be of type 'number', but here has type '3'.

841   readonly HIERARCHY_REQUEST_ERR: 3;
               ~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3924:14
    3924     readonly HIERARCHY_REQUEST_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~~~
    'HIERARCHY_REQUEST_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:842:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'WRONG_DOCUMENT_ERR' must be of type 'number', but here has type '4'.

842   readonly WRONG_DOCUMENT_ERR: 4;
               ~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3945:14
    3945     readonly WRONG_DOCUMENT_ERR: number;
                      ~~~~~~~~~~~~~~~~~~
    'WRONG_DOCUMENT_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:843:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INVALID_CHARACTER_ERR' must be of type 'number', but here has type '5'.

843   readonly INVALID_CHARACTER_ERR: 5;
               ~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3928:14
    3928     readonly INVALID_CHARACTER_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~~~
    'INVALID_CHARACTER_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:844:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NO_DATA_ALLOWED_ERR' must be of type 'number', but here has type '6'.

844   readonly NO_DATA_ALLOWED_ERR: 6;
               ~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3936:14
    3936     readonly NO_DATA_ALLOWED_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~
    'NO_DATA_ALLOWED_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:845:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NO_MODIFICATION_ALLOWED_ERR' must be of type 'number', but here has type '7'.

845   readonly NO_MODIFICATION_ALLOWED_ERR: 7;
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3937:14
    3937     readonly NO_MODIFICATION_ALLOWED_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'NO_MODIFICATION_ALLOWED_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:846:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NOT_FOUND_ERR' must be of type 'number', but here has type '8'.

846   readonly NOT_FOUND_ERR: 8;
               ~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3934:14
    3934     readonly NOT_FOUND_ERR: number;
                      ~~~~~~~~~~~~~
    'NOT_FOUND_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:847:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NOT_SUPPORTED_ERR' must be of type 'number', but here has type '9'.

847   readonly NOT_SUPPORTED_ERR: 9;
               ~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3935:14
    3935     readonly NOT_SUPPORTED_ERR: number;
                      ~~~~~~~~~~~~~~~~~
    'NOT_SUPPORTED_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:848:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INUSE_ATTRIBUTE_ERR' must be of type 'number', but here has type '10'.

848   readonly INUSE_ATTRIBUTE_ERR: 10;
               ~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3926:14
    3926     readonly INUSE_ATTRIBUTE_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~
    'INUSE_ATTRIBUTE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:849:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INVALID_STATE_ERR' must be of type 'number', but here has type '11'.

849   readonly INVALID_STATE_ERR: 11;
               ~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3931:14
    3931     readonly INVALID_STATE_ERR: number;
                      ~~~~~~~~~~~~~~~~~
    'INVALID_STATE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:850:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'SYNTAX_ERR' must be of type 'number', but here has type '12'.

850   readonly SYNTAX_ERR: 12;
               ~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3940:14
    3940     readonly SYNTAX_ERR: number;
                      ~~~~~~~~~~
    'SYNTAX_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:851:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INVALID_MODIFICATION_ERR' must be of type 'number', but here has type '13'.

851   readonly INVALID_MODIFICATION_ERR: 13;
               ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3929:14
    3929     readonly INVALID_MODIFICATION_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'INVALID_MODIFICATION_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:852:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NAMESPACE_ERR' must be of type 'number', but here has type '14'.

852   readonly NAMESPACE_ERR: 14;
               ~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3932:14
    3932     readonly NAMESPACE_ERR: number;
                      ~~~~~~~~~~~~~
    'NAMESPACE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:853:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INVALID_ACCESS_ERR' must be of type 'number', but here has type '15'.

853   readonly INVALID_ACCESS_ERR: 15;
               ~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3927:14
    3927     readonly INVALID_ACCESS_ERR: number;
                      ~~~~~~~~~~~~~~~~~~
    'INVALID_ACCESS_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:854:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'VALIDATION_ERR' must be of type 'number', but here has type '16'.

854   readonly VALIDATION_ERR: 16;
               ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3944:14
    3944     readonly VALIDATION_ERR: number;
                      ~~~~~~~~~~~~~~
    'VALIDATION_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:855:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'TYPE_MISMATCH_ERR' must be of type 'number', but here has type '17'.

855   readonly TYPE_MISMATCH_ERR: 17;
               ~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3942:14
    3942     readonly TYPE_MISMATCH_ERR: number;
                      ~~~~~~~~~~~~~~~~~
    'TYPE_MISMATCH_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:856:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'SECURITY_ERR' must be of type 'number', but here has type '18'.

856   readonly SECURITY_ERR: 18;
               ~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3939:14
    3939     readonly SECURITY_ERR: number;
                      ~~~~~~~~~~~~
    'SECURITY_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:857:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'NETWORK_ERR' must be of type 'number', but here has type '19'.

857   readonly NETWORK_ERR: 19;
               ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3933:14
    3933     readonly NETWORK_ERR: number;
                      ~~~~~~~~~~~
    'NETWORK_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:858:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'ABORT_ERR' must be of type 'number', but here has type '20'.

858   readonly ABORT_ERR: 20;
               ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3921:14
    3921     readonly ABORT_ERR: number;
                      ~~~~~~~~~
    'ABORT_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:859:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'URL_MISMATCH_ERR' must be of type 'number', but here has type '21'.

859   readonly URL_MISMATCH_ERR: 21;
               ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3943:14
    3943     readonly URL_MISMATCH_ERR: number;
                      ~~~~~~~~~~~~~~~~
    'URL_MISMATCH_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:860:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'QUOTA_EXCEEDED_ERR' must be of type 'number', but here has type '22'.

860   readonly QUOTA_EXCEEDED_ERR: 22;
               ~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3938:14
    3938     readonly QUOTA_EXCEEDED_ERR: number;
                      ~~~~~~~~~~~~~~~~~~
    'QUOTA_EXCEEDED_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:861:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'TIMEOUT_ERR' must be of type 'number', but here has type '23'.

861   readonly TIMEOUT_ERR: 23;
               ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3941:14
    3941     readonly TIMEOUT_ERR: number;
                      ~~~~~~~~~~~
    'TIMEOUT_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:862:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'INVALID_NODE_TYPE_ERR' must be of type 'number', but here has type '24'.

862   readonly INVALID_NODE_TYPE_ERR: 24;
               ~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3930:14
    3930     readonly INVALID_NODE_TYPE_ERR: number;
                      ~~~~~~~~~~~~~~~~~~~~~
    'INVALID_NODE_TYPE_ERR' was also declared here.

../node_modules/bun-types/globals.d.ts:863:12 - error TS2717: Subsequent property declarations must have the same type.  Property 'DATA_CLONE_ERR' must be of type 'number', but here has type '25'.

863   readonly DATA_CLONE_ERR: 25;
               ~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:3922:14
    3922     readonly DATA_CLONE_ERR: number;
                      ~~~~~~~~~~~~~~
    'DATA_CLONE_ERR' was also declared here.

../node_modules/bun-types/wasm.d.ts:133:7 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Global' must be of type '{ new (descriptor: GlobalDescriptor<keyof ValueTypeMap>, v?: any): Global<keyof ValueTypeMap>; prototype: Global<keyof ValueTypeMap>; }', but here has type '{ new <T extends keyof ValueTypeMap = keyof ValueTypeMap>(descriptor: GlobalDescriptor<T>, v?: ValueTypeMap[T]): Global<T>; prototype: Global<...>; }'.

133   var Global: {
          ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17364:9
    17364     var Global: {
                  ~~~~~~
    'Global' was also declared here.


Found 36 errors in 5 files.

Errors  Files
     1  node_modules/typescript/lib/lib.dom.d.ts:17429
     4  ../node_modules/bun-types/bun.d.ts:20
     1  ../node_modules/bun-types/bun.ns.d.ts:4
    29  ../node_modules/bun-types/globals.d.ts:237
     1  ../node_modules/bun-types/wasm.d.ts:133

azd version 1.14.0 (commit c928795c47f27d1e997c217147dc649054ac05c8)

on mac osx

It looks like it is somehow trying to get some stuff from the root's parent node_modules and not the current one

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