Redis question to migrate my back end

in this tutorial https://www.youtube.com/watch?v=9GtysZs-FrA in the redis section at minute 5:56 of the video there is a moralis subscription how do I do this procedure, since I start migrating to my own back end

you can use your own redis connection if you want, you need a redis connection string in order to connect to a redis database

Ok, I managed to configure the redist url, now it returns this error when trying to run the server with yarn dev, I already ran yarn build:

PS C:\Users\david\Desktop\moralisServer\back-end> yarn dev    
yarn run v1.22.19
$ ts-node src/index.ts
warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
C:\Users\david\Desktop\moralisServer\back-end\node_modules\@moralisweb3\parse-server\lib\index.js:1
export * from './streams';
^^^^^^

SyntaxError: Unexpected token 'export'
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1055:15)
    at Module._compile (node:internal/modules/cjs/loader:1090:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Object.require.extensions.<computed> [as .js] (C:\Users\david\Desktop\moralisServer\back-end\node_modules\ts-node\src\index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I just saw the issue on the github repository https://github.com/MoralisWeb3/Moralis-JS-SDK/issues/1022

I can’t run server 1.1

Hey @davidzuccarini,

Can you confirm that you are using Moralis SDK v2.14? And if so, can you try updating your SDK to v.2.15?

If I confirm, I tried to downgrade and it didn’t work either

Hey @davidzuccarini,

How about upgrading to v2.15? Coz the update might be included in the newer version instead of the older one, which likely cause downgrading not to work since the issue persist in prior versions.

I comment what I have tried, I downgrade to version 2.13.0, 2.14, 2.15 and the latest 2.16.1, I have node version 16.17.1 npm version 8.15.0, yarn version 1.22.19, I delete the folder in each downgrade node modules, and install everything every version change and nothing gives me the same error.

and I run the commands in order once the package is configured. json:
yarn install
yarn build
yarn dev

Hey @davidzuccarini,

Thanks for giving all the info and making things clear. I know this can be frustrating, so I’ll be sure to let the devs know about this. This issue isn’t only happening on your end alone so others are also getting it.

I understand that this is an urgent issue, so I’ll get the devs to investigate and make the fix ASAP on this and will keep you posted if there is any update.

If you have any questions, feel free to let me know.

I think I see the error is that import
C:\Users\david\Desktop\moralisServer\back-end\node_modules@moralisweb3\parse-server\lib\index.js is a .js when referencing a .ts typescript, when I do the file change , it gives me another error:

Error: Cannot find module 'C:\Users\david\Desktop\moralisServer\back-end\node_modules\@moralisweb3\parse-server\lib\index.js'. Please verify that the package.json has a valid "main" entry
     at tryPackage (node:internal/modules/cjs/loader:364:19)
     at Function.Module._findPath (node:internal/modules/cjs/loader:577:18)
     at Function.Module._resolveFilename(node:internal/modules/cjs/loader:942:27)
     at Module._compile (node:internal/modules/cjs/loader:1126:14) at Module.m._compile (C:\Users\david\Desktop\moralisServer\back-end\node_modules\ts-node\src\index .ts:1618:23) {
   code: 'MODULE_NOT_FOUND',
   path: 'C:\\Users\\david\\Desktop\\moralisServer\\back-end\\node_modules\\@moralisweb3\\parse-server\\package.json',
   requestPath: '@moralisweb3/parse-server'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I hope to be helpful.

1 Like

Hey @davidzuccarini,

appreciate the effort :pray: but looks like the error that you have is unfortunately indicates the file you’re putting for main import is wrong, does not mean it does not exist, but the configuration you changed might not be right for package.json

1 Like

if I already saw it, don’t change the type in the json package of the parse serve and it doesn’t return the same error:

PS C:\Users\david\Desktop\moralisServer\back-end> yarn dev
yarn run v1.22.19
$ ts-node src/index.ts
warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
C:\Users\david\Desktop\moralisServer\back-end\node_modules\@moralisweb3\parse-server\lib\index.ts:1
export * from './streams';
^^^^^^

SyntaxError: Unexpected token 'export'
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1055:15)
    at Module._compile (node:internal/modules/cjs/loader:1090:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\david\Desktop\moralisServer\back-end\node_modules\ts-node\src\index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.