Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module parse failed: Unexpected character '�' (1:0) #759

Open
isaced opened this issue Feb 13, 2024 · 1 comment
Open

Module parse failed: Unexpected character '�' (1:0) #759

isaced opened this issue Feb 13, 2024 · 1 comment

Comments

@isaced
Copy link

isaced commented Feb 13, 2024

I get an error when I run it.

> next dev

   ▲ Next.js 14.1.0
   - Local:        http://localhost:3000
   - Environments: .env

 ✓ Ready in 2.3s
 ○ Compiling /middleware ...
 ✓ Compiled /middleware in 731ms (285 modules)
<w> [webpack.cache.PackFileCacheStrategy] Serializing big strings (101kiB) impacts deserialization performance (consider using Buffer instead and decode when needed)
 ○ Compiling /[projectId] ...
 ⨯ ./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Import trace for requested module:
./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
./node_modules/ssh2/lib/protocol/crypto.js
./node_modules/ssh2/lib/keygen.js
./node_modules/ssh2/lib/index.js
./node_modules/docker-modem/lib/ssh.js
./node_modules/docker-modem/lib/modem.js
./node_modules/dockerode/lib/docker.js
./services/executor.ts
./services/deploy.ts
./app/[projectId]/page.tsx
 ⨯ ./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Import trace for requested module:
./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
./node_modules/ssh2/lib/protocol/crypto.js
./node_modules/ssh2/lib/protocol/keyParser.js
./node_modules/ssh2/lib/index.js
./node_modules/docker-modem/lib/ssh.js
./node_modules/docker-modem/lib/modem.js
./node_modules/dockerode/lib/docker.js
./services/executor.ts
./services/deploy.ts
./app/[projectId]/page.tsx
 ⨯ ./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Import trace for requested module:
./node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node
./node_modules/ssh2/lib/protocol/crypto.js
./node_modules/ssh2/lib/protocol/keyParser.js
./node_modules/ssh2/lib/index.js
./node_modules/docker-modem/lib/ssh.js
./node_modules/docker-modem/lib/modem.js
./node_modules/dockerode/lib/docker.js
./services/executor.ts

Env:

  • dockerode: 4.0.2
  • Next.js 14.1.0
  • node: v20.10.0
  • npm: 10.2.3
@muratGG
Copy link

muratGG commented Feb 29, 2024

Change your next config like this and add dockerode to serverComponentsExternalPackages list.

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    serverComponentsExternalPackages: ["dockerode"],
  },
};

export default nextConfig;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants