Describe the bug
when I run project then i face this type of error, error is window is not defined.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Help solve this error
Screenshots

Additional context
-
Possible solutions
-
Please complete the following device information:
npm -v:5.8.0node -v:10.15.2
Please let us know what packages this bug is in regards to:
venia-conceptvenia-uipwa-buildpackperegrinepwa-devdocsupward-jsupward-speccreate-pwaFlagged for prioritization during backlog grooming
I tried but could not reproduce this issue.
develop branch.yarn installbash docker/run-dockerMy 8080 port is already in use, so ran on 8008. ( docker/.env.docker.dev > DEV_SERVER_PORT )

@pankajvc are you still experiencing this issue? I'll close based on Dev's last comment but feel free to re-open with additional repro details if you're still seeing this.
@awilcoxa , @dpatil-magento Thanks for the support. I have fixed this issue.
@pankajvc How did you fix this issue ? I have the same issue ? @dpatil-magento what about master branch ? Because on develop this is ok, but on the master branch I got the same things what @pankajvc shows.
@pankajvc How did you fix this issue ? I have the same issue ? @dpatil-magento what about master branch ? Because on develop this is ok, but on the master branch I got the same things what @pankajvc shows.
Please go to this path in your project pwa-studio/packages/venia-concept/webpack.config.js then compare your file this code `const {
configureWebpack,
graphQL: { getMediaURL, getUnionAndInterfaceTypes }
} = require('@magento/pwa-buildpack');
const { DefinePlugin } = require('webpack');
const HTMLWebpackPlugin = require('html-webpack-plugin');
module.exports = async env => {
const mediaUrl = await getMediaURL();
global.MAGENTO_MEDIA_BACKEND_URL = mediaUrl;
const unionAndInterfaceTypes = await getUnionAndInterfaceTypes();
const { clientConfig, serviceWorkerConfig } = await configureWebpack({
context: __dirname,
vendor: [
'@apollo/react-hooks',
'apollo-cache-inmemory',
'apollo-cache-persist',
'apollo-client',
'apollo-link-context',
'apollo-link-http',
'informed',
'react',
'react-dom',
'react-feather',
'react-redux',
'react-router-dom',
'redux',
'redux-actions',
'redux-thunk'
],
special: {
'react-feather': {
esModules: true
},
'@magento/peregrine': {
esModules: true,
cssModules: true
},
'@magento/venia-ui': {
cssModules: true,
esModules: true,
graphqlQueries: true,
rootComponents: true,
upward: true
}
},
env
});
/**
* configureWebpack() returns a regular Webpack configuration object.
* You can customize the build by mutating the object here, as in
* this example. Since it's a regular Webpack configuration, the object
* supports the `module.noParse` option in Webpack, documented here:
* https://webpack.js.org/configuration/module/#modulenoparse
*/
clientConfig.module.noParse = [/braintree\-web\-drop\-in/];
clientConfig.plugins = [
...clientConfig.plugins,
new DefinePlugin({
/**
* Make sure to add the same constants to
* the globals object in jest.config.js.
*/
UNION_AND_INTERFACE_TYPES: JSON.stringify(unionAndInterfaceTypes),
STORE_NAME: JSON.stringify('ShopAppy')
}),
new HTMLWebpackPlugin({
filename: 'index.html',
template: './template.html',
minify: {
collapseWhitespace: true,
removeComments: true
}
})
];
serviceWorkerConfig.output = {
globalObject: 'this'
};
return [clientConfig, serviceWorkerConfig];
};`
@pankajvc How did you fix this issue ? I have the same issue ? @dpatil-magento what about master branch ? Because on develop this is ok, but on the master branch I got the same things what @pankajvc shows.
serviceWorkerConfig.output = {
globalObject: 'this'
};
please add this code in the file
@pankajvc I will check it, do you use monorepo with all packages or do you use pwa studio by npm packages ? Master or develop ?
@pankajvc I will check it, do you use monorepo with all packages or do you use pwa studio by npm packages ? Master or develop ?
I'm using PWA studio by NPM packages form to master