question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDK Version 2.0/2.0.1 Error TS2307: Cannot find module './StateOptions.type' or its corresponding type declarations

See original GitHub issue

Expected Behavior

When executing tsc on a project with dapr client version 2.0 and 2.0.1 the build process should not run on a TS2307 error due to wrong imports.

Actual Behavior

When executing tsc on a project with dapr client version 2.0 and 2.0.1 the build process should raises a TS2307 error due to wrong imports.

namely:

node_modules/dapr-client/types/Request.type.d.ts:3:31 - error TS2307: Cannot find module './StateOptions.type' or its corresponding type declarations.

3 import { IStateOptions } from "./StateOptions.type";

Reason is that the definition of IStateOptions is located at ./state/StateOptions.type. The import in the file Request.type.ts must be adjusted correspondingly:

import { IEtag } from "./Etag.type";
import { IRequestMetadata } from "./RequestMetadata.type";
import { IStateOptions } from "./state/StateOptions.type";
export declare type IRequest = {
    key: string;
    value?: any;
    etag?: IEtag;
    metadata?: IRequestMetadata;
    options?: IStateOptions;
};

Steps to Reproduce the Problem

Create a JavaScript project with the dapr client 2.0 or 2.0.1 and try to build the project

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
XavierGeerinckcommented, Feb 8, 2022

I agree, there is something going on in the build step. I am not sure build.sh runs during the tests either, but there is a more to it. I added a reference to the new issue #177 so we can close this one for now

1reaction
lechnerc77commented, Feb 7, 2022

I indeed did not check the build and test steps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module or its corresponding type declarations ...
So my-parser-generator basically offers JavaScript files to a TypeScript consumer. But when I try to import the newly generated parser I get the ......
Read more >
"error TS2307: Cannot find module" when using @types/ws ...
Expected behavior: should found the type defination of ws. Actual behavior: TS2307 error. It's not like the problem from @types/ws , because ...
Read more >
TIL: TypeScript | Fix "TS2307: Cannot find module 'src' or its ...
Question. How to fix? error TS2307: Cannot find module 'src' or its corresponding type declarations.
Read more >
"TS2307: Cannot find module" error displayed while project ...
"TS2307: Cannot find module" error displayed while project could be built without problems. What steps will reproduce the problem? 1. Create a TypeScript...
Read more >
[SUPPORT] Can't update Device SDK in Armoury Crate : r/ASUS
On my brand new build using with Rog Strix Z490-E Gaming when trying to select my device in Armoury Crate it says "You...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found