Next.js 13 Error using next/script in app directory #50323
Unanswered
Pooh224
asked this question in
App Router
Replies: 1 comment
-
i think we meet same problem, do u resolve yet? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Next.js 13 Error using next/script in app directory
The following error occurs when importing an external third party script through next/script.
Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'getReader')
Call Stack
startReadingFromStream
node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.browser.development.js (1739:0)
eval
node_modules\next\dist\compiled\react-server-dom-webpack\cjs\react-server-dom-webpack-client.browser.development.js (1771:0)
react-server-dom-webpack-client.browser.development.js:1739 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getReader')
function startReadingFromStream(response, stream) {
var reader = stream.getReader();
function progress(_ref) {
var done = _ref.done,
value = _ref.value;
}
function error(e) {
reportGlobalError(response, e);
}
} reader.read().then(progress).catch(error);
}
function createFromReadableStream(stream, options) {
var response = createResponseFromOptions(options);
startReadingFromStream(response, stream);
return getRoot(response);
}
} function createFromFetch(promiseForResponse, options) {
var response = createResponseFromOptions(options);
promiseForResponse.then(function (r) {
startReadingFromStream(response, r.body);
}, function (e) {
reportGlobalError(response, e);
});
return getRoot(response);
}
Could it be the case that there is a conflict with react server components when loading a third party script?
Could you please advise me which part to check?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions