You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when we build Angular app it gives an error on node_modules/swagger-ui-dist/absolute-path.js:9:19:
const getAbsoluteFSPath = function () {
// detect whether we are running in a browser or nodejs
if (typeof module !== "undefined" && module.exports) {
return require("path").resolve(__dirname)
}
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
}
export default getAbsoluteFSPath
by removing the line return require("path").resolve(__dirname) it solve the issue . any other possible fix for that please?
The text was updated successfully, but these errors were encountered:
using try catch solved the issue
const getAbsoluteFSPath = function () {
// detect whether we are running in a browser or nodejs
if (typeof module !== "undefined" && module.exports) {
try {
return require("path").resolve(__dirname)
}
catch (e) {
throw new Error('Unable to determine the current working directory')
}
}
}
when we build Angular app it gives an error on node_modules/swagger-ui-dist/absolute-path.js:9:19:
const getAbsoluteFSPath = function () {
// detect whether we are running in a browser or nodejs
if (typeof module !== "undefined" && module.exports) {
return require("path").resolve(__dirname)
}
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
}
export default getAbsoluteFSPath
by removing the line return require("path").resolve(__dirname) it solve the issue . any other possible fix for that please?
The text was updated successfully, but these errors were encountered: