MoralisWeb3 / Moralis-JS-SDK

Moralis Official Javascript SDK
https://docs.moralis.io
Other
368 stars 257 forks source link

yarn build project is not working because morals module is missing #1016

Closed ViktorVegh closed 1 year ago

ViktorVegh commented 1 year ago

New Bug Report

Checklist

Issue Description

I downloaded parse-server-migration and opened it as new project, after I run yarn install and followed steps but when I wanted to run yarn build terminal wrote me that: Cannot find module 'moralis' or its corresponding type declarations. I have tried to add moralis to project with yarn add moralis but after I run yarn install its showing same error.

Steps + code to reproduce

1 import Moralis from 'moralis';


src/auth/MoralisEthAdapter.ts:3:21 - error TS2307: Cannot find module 'moralis' or its corresponding type declarations.

3 import Moralis from 'moralis';

src/auth/MoralisEthAdapter.ts:14:12 - error TS7006: Parameter 'result' implicitly has an 'any' type.

14 .then((result) => {


src/cloud/generated/evmApi.ts:4:21 - error TS2307: Cannot find module 'moralis' or its corresponding type declarations.

4 import Moralis from 'moralis'

src/cloud/generated/evmApi.ts:5:41 - error TS2307: Cannot find module '@moralisweb3/common-core' or its corresponding type declarations.

5 import { MoralisError, Operation } from '@moralisweb3/common-core';


src/cloud/generated/evmApi.ts:9:28 - error TS2307: Cannot find module '@moralisweb3/common-evm-utils' or its corresponding type declarations.

9 import { operations } from '@moralisweb3/common-evm-utils';

src/cloud/generated/evmApi.ts:16:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

16 error.cause &&


src/cloud/generated/evmApi.ts:17:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

17     error.cause instanceof AxiosError &&

src/cloud/generated/evmApi.ts:18:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

18 error.cause.response &&


src/cloud/generated/evmApi.ts:19:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

19     error.cause.response.data

src/cloud/generated/evmApi.ts:21:33 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

21 return JSON.stringify(error.cause.response.data);


src/cloud/generated/evmApi.ts:32:38 - error TS7006: Parameter 'o' implicitly has an 'any' type.

32   const operation = operations.find((o) => o.name === operationName);
                                        ~

src/cloud/generated/solApi.ts:4:21 - error TS2307: Cannot find module 'moralis' or its corresponding type declarations.

4 import Moralis from 'moralis'

src/cloud/generated/solApi.ts:5:41 - error TS2307: Cannot find module '@moralisweb3/common-core' or its corresponding type declarations.

5 import { MoralisError, Operation } from '@moralisweb3/common-core';


src/cloud/generated/solApi.ts:9:28 - error TS2307: Cannot find module '@moralisweb3/common-sol-utils' or its corresponding type declarations.

9 import { operations } from '@moralisweb3/common-sol-utils';

src/cloud/generated/solApi.ts:16:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

16 error.cause &&


src/cloud/generated/solApi.ts:17:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

17     error.cause instanceof AxiosError &&

src/cloud/generated/solApi.ts:18:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

18 error.cause.response &&


src/cloud/generated/solApi.ts:19:11 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

19     error.cause.response.data

src/cloud/generated/solApi.ts:21:33 - error TS2550: Property 'cause' does not exist on type 'Error'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2022' or later.

21 return JSON.stringify(error.cause.response.data);


src/cloud/generated/solApi.ts:32:38 - error TS7006: Parameter 'o' implicitly has an 'any' type.

32   const operation = operations.find((o) => o.name === operationName);
                                        ~

src/cloud/upgradeRequest.test.ts:6:8 - error TS2307: Cannot find module '@moralisweb3/common-evm-utils' or its corresponding type declarations.

6 } from '@moralisweb3/common-evm-utils';

src/cloud/upgradeRequest.ts:2:36 - error TS2307: Cannot find module '@moralisweb3/common-core' or its corresponding type declarations.

2 import { Operation, toCamel } from '@moralisweb3/common-core';


src/index.ts:1:21 - error TS2307: Cannot find module 'moralis' or its corresponding type declarations.

1 import Moralis from 'moralis';

src/index.ts:10:29 - error TS2307: Cannot find module '@moralisweb3/parse-server' or its corresponding type declarations.

10 import { streamsSync } from '@moralisweb3/parse-server';



Found 25 errors in 7 files.

Errors  Files
     1  src/auth/authService.ts:1
     2  src/auth/MoralisEthAdapter.ts:3
     9  src/cloud/generated/evmApi.ts:4
     9  src/cloud/generated/solApi.ts:4
     1  src/cloud/upgradeRequest.test.ts:6
     1  src/cloud/upgradeRequest.ts:2
     2  src/index.ts:1

<!-- What outcome, for example query result, did you get? -->

project build success

<!-- What outcome, for example query result, did you expect? -->

### Environment

<!-- Be specific with versions, don't use "latest" or semver ranges like "~x.y.z" or "^x.y.z". -->

Server

- Moralis server version: `FILL_THIS_OUT`

Client

- Moralis SDK version: `FILL_THIS_OUT`
- Operating system: `FILL_THIS_OUT`
- Browser: `FILL_THIS_OUT`

### Logs

<!-- Include relevant logs here -->
b4rtaz commented 1 year ago

I've just tested it and it seems to work properly. Which version of node/npm/yarn do you have?

Thee-sage commented 1 year ago

did you find how to solve this?

b4rtaz commented 1 year ago

This problem doesn't look like a problem with our codebase. Our CI proves that the repository builds correctly.

If that problem still appears, please find help on the Moralis forum.