#Missing Modules, only on client.

23 messages · Page 1 of 1 (latest)

sullen walrus
#

Trying to set 'tls' and 'net' 'empty' on the client through webpack, and config.node doesn't exist on next 13.

in next.config.js I added:

  webpack: (config, { isServer }) => {
    // Fixes npm packages that depend on `tls,net` module
    console.log(isServer);
    if (!isServer) {
      console.log(config);
      config.node = {
        tls: 'empty',
        net: 'empty'
      }
    }

    return config
  }  

redis is trying to find 'tls' and 'net', and I think this might be a solution.

Thank you

old sierra
sullen walrus
#

I'm having errors saying 'tls' and 'net' modules are missing.

#

and I believe it's the client trying to find these modules

old sierra
sullen walrus
#

Sorry it's an image

#

Just wondering what the new way to set a node to be empty.

old sierra
#

You're trying to use redis client on the frontend?

sullen walrus
#

I can fetch in page.tsx, it's when I fetch from anywhere it else brings up this error.

#

yes

old sierra
sullen walrus
#

well, I can from page.tsx

old sierra
sullen walrus
#

So components that page.tsx calls isn't running on the server?

old sierra
sullen walrus
#

It is not 'use client'

#

But, thanks for the feedback, it's giving me some food for though

old sierra
sullen walrus
#

I believe we have that setup with a dedicated service via docker, just trying a lot of different solutions. and thinking it's webpack issues.

old sierra
sullen walrus
#

I connect too, it's just one component level down from page.tsx in a server component brings up the error.

odd brookBOT
# sullen walrus Trying to set 'tls' and 'net' 'empty' on the client through webpack, and config...
Please add more information to your question

Your question currently does not have sufficient information for people to be able to help. Please add more information to help us help you, for example: relevant code snippets, a reproduction repository, and/or more detailed error messages. See more info on how to ask a good question in https://discord.com/channels/752553802359505017/1138338531983491154 and #welcome message