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

Introduce Kafkajs startup project prompt Invalid or unexpected token #1702

Open
chargeduck opened this issue Jul 2, 2024 · 0 comments
Open

Comments

@chargeduck
Copy link

Describe the bug
Use electorn-vue to build the project, and Introduce Kafkajs startup project prompt Invalid or unexpected token after introducing Kafkajs

To Reproduce
Please provide either a link to a:

  1. repository with an example project reproducing the issue
const {Kafka} = require('kafkajs');
export default {
  data() {
    return {
      electron: process.versions.electron,
      node: process.versions.node,
      platform: require('os').platform(),
      vue: require('vue/package.json').version,
      kafkaClient: null,
    }
  },
  created() {
    this.initKafkaConn()
  },
  methods: {
    initKafkaConn() {
      // Create the client with the broker list
      const client = new Kafka({
        clientId: 'my-app',
        brokers: ['192.168.242.130:9092']
      })
      console.log(client)
    }
  }

}

If none of the above are possible to provide, please write down the exact steps to reproduce the behavior:

  1. npm install -g vue-cli
  2. vue init simulatedgreg/electron-vue my-project
  3. cd my-project
  4. npm install kafkajs
  5. Introduce kafkajs to get metadata for testing

Expected behavior
Succeeded The server can connect to 192.168.242.130:9092 and obtain metadata

Observed behavior
Invalid or unexpected token
image

Environment:

  • OS: [Windows 11]
  • KafkaJS version [2.2.4]
  • Kafka version [3.7.0]
  • NodeJS version [18.16.0]

Additional context
Add any other context about the problem here.

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

1 participant