D
D
DMITRY Chernenkiy2021-07-23 14:50:05
React
DMITRY Chernenkiy, 2021-07-23 14:50:05

What is this import error?

There is a project built on next.js
It has a next.config.js file that looks like this

const path = require('path')

module.exports = {
  publicRuntimeConfig: {
//разный код
  },
  webpack(config) {
  //разный код
  },
}

but when i want to add another import
const { withSentryConfig } = require('@sentry/nextjs')

The whole build breaks and when I run npm it gives this error
(node:10436) Warning: Accessing non-existent property 'default' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10436) Warning: Accessing non-existent property 'target' of module exports inside circular dependency
(node:10436) Warning: Accessing non-existent property 'amp' of module exports inside circular dependency
(node:10436 ) Warning: Accessing non-existent property 'experimental' of module exports inside circular dependency
Where could such an error come from in which direction to look for a problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-07-23
@Aleksandr-JS-Developer

Do you want to import Next`a config into Next`a config? And in the config, import the config, and so on ad infinitum.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question