Closed duniang818 closed 3 weeks ago
To resolve the issue with the error message "Content not from webpack is served from 'D:\tech_release\superset-fork\superset\static\assets' directory" when running npm run dev-server
on Windows 10 with Superset version 4.0.1, ensure that the static
directory is correctly referenced in your webpack.config.js
file.
Verify Directory Structure:
Ensure that the directory D:\tech_release\superset-fork\superset\static\assets
exists and contains the necessary static assets.
Adjust Path if Necessary:
If the directory structure is different, adjust the path in the webpack.config.js
file. For example:
if (isDevMode) {
config.devServer = {
static: path.join(__dirname, 'path/to/your/static/assets'),
};
}
Replace 'path/to/your/static/assets'
with the actual path to your static/assets
directory.
Check Permissions: Ensure you have the necessary permissions to access the directory on your Windows 10 system.
The error "Error occurred while trying to proxy: localhost:9000" suggests an issue with the proxy configuration:
Backend Server Not Running:
Ensure the Superset backend server is running on the expected port (default is 8088). Start the server using superset run -p 8088
.
Incorrect Backend URL or Port:
Verify the backend URL and port in the webpack.proxy-config.js
file:
const { supersetPort = 8088, superset: supersetUrl = null } = parsedEnvArg();
const backend = (supersetUrl || `http://localhost:${supersetPort}`).replace(
'//+$/',
'',
);
Ensure supersetPort
is set to the correct port where the Superset backend is running.
Network Issues:
Check your network connection and ensure there are no firewalls or other network configurations blocking the connection to localhost:8088
.
Proxy Configuration Errors: Review the proxy configuration for any syntax errors or misconfigurations. The configuration should look like this:
module.exports = newManifest => {
manifest = newManifest;
return {
context: '/',
target: backend,
hostRewrite: true,
changeOrigin: true,
cookieDomainRewrite: '', // remove cookie domain
selfHandleResponse: true, // so that the onProxyRes takes care of sending the response
onProxyRes(proxyResponse, request, response) {
try {
copyHeaders(proxyResponse, response);
if (isHTML(response)) {
processHTML(proxyResponse, response);
} else {
proxyResponse.pipe(response);
}
response.flushHeaders();
} catch (e) {
response.setHeader('content-type', 'text/plain');
response.write(`Error requesting ${request.path} from proxy:\n\n`);
response.end(e.stack);
}
},
};
};
By addressing these common causes, you should be able to resolve the issues with the development server and proxy configuration in Superset. If you continue to experience problems, please provide additional details about the directory structure and any specific error messages you encounter.
To continue the conversation, mention @dosu.
i have checked the config file both webpack.config.js, webpack.proxy-config.js and superest_config.py, there everything is ok, i don't find something is wrong.
the assets exist in the dir D:\tech_release\superset-fork\superset\static\assets.
the structure is :
D:\tech_release\superset-fork
D:\tech_release\superset-fork\superset
PS D:\tech_release\superset-fork\superset superset run -p 8088
D:\tech_release\superset-fork\superset\superset_config.py
D:\tech_release\superset-fork\superset\static\assets
D:\tech_release\superset-fork\superset-frontend
PS D:\tech_release\superset-fork\superset-frontend npm install && npm run dev-server
D:\tech_release\superset-fork\superset-frontend\webpack.config.js
D:\tech_release\superset-fork\superset-frontend\webpack.proxy-config.js
D:\tech_release\superset-fork\superset-frontend\package.json
everything is above, but don't work now.
i have checked the config file both webpack.config.js, webpack.proxy-config.js and superest_config.py, there everything is ok, i don't find something is wrong.
the assets exist in the dir D:\tech_release\superset-fork\superset\static\assets.
the structure is :
D:\tech_release\superset-fork
D:\tech_release\superset-fork\superset
PS D:\tech_release\superset-fork\superset superset run -p 8088
D:\tech_release\superset-fork\superset\superset_config.py
D:\tech_release\superset-fork\superset\static\assets
D:\tech_release\superset-fork\superset-frontend
PS D:\tech_release\superset-fork\superset-frontend npm install && npm run dev-server
D:\tech_release\superset-fork\superset-frontend\webpack.config.js
D:\tech_release\superset-fork\superset-frontend\webpack.proxy-config.js
D:\tech_release\superset-fork\superset-frontend\package.json
everything is above, but don't work now.
static: path.join(__dirname, '../superset/static/assets'),
const { supersetPort = 8088, superset: supersetUrl = null } = parsedEnvArg();
const backend = (supersetUrl || http://localhost:${supersetPort}
).replace(
'//+$/',
'',
); // strip ending backslash
前端编译后就可以了。 全部前后端Windows源码部署请参考:https://zhuanlan.zhihu.com/p/710483750
Bug description
npm run dev-server on windows 10 lastest superset 4.0.1 npm: 10.2.4 node: 18.19.1 python: 3.11.5
How to reproduce the bug
cd D:\tech_release\superset-fork\superset-frontend
webpack.config.js config is:
npm install
npm run dev-server
the result from browser:
Screenshots/recordings
No response
Superset version
4.0.1
Python version
3.11
Node version
18 or greater
Browser
Chrome
Additional context
No response
Checklist