chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
319 stars 70 forks source link

Module not found: Can't resolve './src/build' #114

Closed raed667 closed 2 years ago

raed667 commented 6 years ago

When building I get this message:


Compiled with warnings.

./node_modules/dtrace-provider/dtrace-provider.js
Module not found: Can't resolve './src/build' in 'C:\`myworkspace\node_modules\dtrace-provider'
``
melloc commented 6 years ago

@RaedsLab What version of dtrace-provider do you have installed? If all you want is for the message to go away, as of 0.8.6, the library should no longer print out those messages if compilation failed and it's falling back on the stub implementation. If you want to see why compilation is failing, take a look at the npm output during install. If you don't see anything, you may want to run with V=1 in your environment. The README in this repo also contains some common reasons for build failures, and might be useful.

pdagosto commented 5 years ago

I'm getting the same error with 0.8.7. I ran with NODE_DTRACE_PROVIDER_REQUIRE=hard and saw no evidence of a build error.

In my case the error on building my project (vue-cli webpack) is:

This relative module was not found:

There is no build directory under src.

I'm on CentOS 7.5 node 6.14.2

bensampaio commented 5 years ago

I'm having the exact same problem. Using dtrace-provider@0.8.7. Could this cause problems? Is there a solution? I would prefer not to supress warnings since that might result in to supressing other important warnings.

kamok commented 5 years ago

I have this same exact issue after downgrading from Node 11 to Node 8. It's a warning but I just ignore it for now.

tobilg commented 4 years ago

I'm having the same warning with dtrace-provider@0.8.8.

Adding the following to my webpack.config.js

...
  externals: [
    'dtrace-provider',
    'fs',
    'mv',
    'os',
    'source-map-support',
  ],
...

solved it for me.

saostad commented 4 years ago

I am getting same error with v 0.8.8

WARNING in ./node_modules/dtrace-provider/dtrace-provider.js
Module not found: Error: Can't resolve './src/build'

it's happening in webpack compile

ahmdrami commented 4 years ago

If you are seeing these warnings in a nextjs app.

module.exports = () => {
  return {
    webpack: (config, { isServer }) => {
      if (!isServer) {
        config.node = {
          fs: 'empty',
        }
        config.externals = ['dtrace-provider', 'fs']
      }

      return config
    },
  }
}

will fix it.

grafanauser commented 1 year ago

I'm having the same warning with dtrace-provider@0.8.8.

Adding the following to my webpack.config.js

...
  externals: [
    'dtrace-provider',
    'fs',
    'mv',
    'os',
    'source-map-support',
  ],
...

solved it for me.

Some background to this: https://github.com/trentm/node-bunyan#webpack