Javascript 如何在razzle express服务器文件中使用@sentry/node
根据节点的设置,只需Javascript 如何在razzle express服务器文件中使用@sentry/node,javascript,node.js,sentry,razzle,Javascript,Node.js,Sentry,Razzle,根据节点的设置,只需 //server.js const Sentry=require(“@Sentry/node”); Sentry.init({dsn:“https://1df8da5e900e440e8d6e767ec6277ff9@o126849.ingest.sentry.io/296346“}); 然而,当我运行razzle start时,我得到了这个 TypeError: mod.require is not a function at dynamicRequire (
//server.js
const Sentry=require(“@Sentry/node”);
Sentry.init({dsn:“https://1df8da5e900e440e8d6e767ec6277ff9@o126849.ingest.sentry.io/296346“});
然而,当我运行razzle start
时,我得到了这个
TypeError: mod.require is not a function
at dynamicRequire (/Users/daniellizik/foo/node_modules/@sentry/utils/esm/node.js:19:1)
at getDefaultSamplingContext (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/tracing/esm/hubextensions.js:107:1)
at Hub._startTransaction (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/tracing/esm/hubextensions.js:162:1)
at Hub.module.exports../node_modules/@sentry/hub/esm/hub.js.Hub._callExtensionMethod (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/hub/esm/hub.js:348:1)
at Hub.module.exports../node_modules/@sentry/hub/esm/hub.js.Hub.startTransaction (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/hub/esm/hub.js:308:1)
at callOnHub (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/minimal/esm/index.js:17:1)
at startTransaction (/Users/daniellizik/foo/build/webpack:/node_modules/@sentry/minimal/esm/index.js:189:1)
在sentry回购协议中有一个通用应用程序,但没有提供解决方案