New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run project on IE 11 #10184
Comments
I searched on the internet. The issue is still there The polyfill.ts file as below // support for IE 11 import 'core-js/proposals/reflect-metadata'; |
We only support evergreen browsers and hence we can't do anything special here. SO please add required polyfills for your use case. Also please follow our issue guidelines next time. |
This ticket has been closed as the guidelines are not followed. Tickets must follow our Guidelines, as mentioned in: We have also created a template on the "create a new ticket" page to help you follow those guidelines. If this is indeed a JHipster bug, please open a new issue with proper details or update this issue with all details and request to reopen. If you have a question please use Stack Overflow, and tag the question with jhipster. This helps the project to keep the issue tracker clean. Also, Stack Overflow will give your question a larger audience:
|
The problem is that sadly we still have many clients asking for IE11 support, and Angular 8 supports such a browser... it could be supported also by JHipster officially, we are currently investigating some solutions. |
@anthony-o Some tips:
|
I think it deserves a tips at jhipster.tech if it's not already done |
thanks @wmarques |
Perhaps the Babel part could be a bit more explicit? By specifying which exact file to modify in the JHipster already generated files in order to insert such a configuration? |
@anthony-o : I would suggest you to contribute, if you know how to improve this tips. As in the core team, we don't use this old browser, so it's impossible for us to test this tips. |
OK I finally found a way to make IE 11 work! First, add those yarn add @babel/core @babel/preset-env babel-loader --exact --dev (tested with the following versions: "@babel/core": "7.6.4",
"@babel/preset-env": "7.6.3",
"babel-loader": "8.0.6", ) Now add the following lines at the top of import 'core-js/stable';
import 'regenerator-runtime/runtime'; In {
test: /manifest.webapp$/,
loader: 'file-loader',
options: {
name: 'manifest.webapp'
}
}, add the following lines: {
test: /\.js/,
use: {
loader: 'babel-loader',
options: {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"firefox": "60",
"ie": "11"
},
"useBuiltIns": "entry",
"corejs": 3
}
]
]
}
},
exclude: /@babel(?:\/|\\{1,2})runtime|core-js/,
}, And finally, change Here is my full test: sudo rm -rf /dev/shm/myproject
cd /dev/shm/
mkdir myproject
cd myproject
mkdir /dev/shm/m2cache /dev/shm/yarncache
sudo tee myproject.jdl <<EOF
application {
config {
baseName MyProject
clientPackageManager yarn
jhiPrefix mp
enableTranslation false
languages [fr]
nativeLanguage fr
packageName com.mycompany.myproject
prodDatabaseType postgresql
skipUserManagement true
}
entities *
}
entity MyEntity {
label String
}
EOF
JHIPSTER_VERSION=v6.3.1
sudo chown -R 1000:1000 . /dev/shm/m2cache /dev/shm/yarncache
docker run -it --rm --name jhipster -v "$(pwd):/home/jhipster/app" -v /dev/shm/m2cache:/home/jhipster/.m2 -v /dev/shm/yarncache:/home/jhipster/.cache/yarn -v "$HOME/.gitconfig:/home/jhipster/.gitconfig:ro" jhipster/jhipster:$JHIPSTER_VERSION jhipster import-jdl ./myproject.jdl --force
# WAIT FOR THE APPLICATION TO BE GENERATED
docker run -it --rm --name jhipster -v "$(pwd):/home/jhipster/app" -v /dev/shm/m2cache:/home/jhipster/.m2 -v /dev/shm/yarncache:/home/jhipster/.cache/yarn -p 9000:9000 -p 8080:8080 jhipster/jhipster:$JHIPSTER_VERSION yarn add @babel/core @babel/preset-env babel-loader --exact --dev
# WAIT FOR THE YARN COMMAND TO END
echo "
import 'core-js/stable';
import 'regenerator-runtime/runtime';
$(cat src/main/webapp/app/polyfills.ts)
" | sudo -u '#1000' tee src/main/webapp/app/polyfills.ts
cat > /dev/shm/webpack.patch <<EOF
{
test: /\.js/,
use: {
loader: 'babel-loader',
options: {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"firefox": "60",
"ie": "11"
},
"useBuiltIns": "entry",
"corejs": 3
}
]
]
}
},
exclude: /@babel(?:\/|\\{1,2})runtime|core-js/,
},
EOF
sudo -u '#1000' sed -i $'/Ignore warnings about System.import in Angular/{e cat /dev/shm/webpack.patch\n}' webpack/webpack.common.js
for FILE in tsconfig.json tsconfig-aot.json; do
sudo -u '#1000' sed -i 's/"target": "es6"/"target": "es5"/' $FILE
done
docker run -it --rm --name jhipster -v "$(pwd):/home/jhipster/app" -v /dev/shm/m2cache:/home/jhipster/.m2 -v /dev/shm/yarncache:/home/jhipster/.cache/yarn -p 9000:9000 -p 8080:8080 jhipster/jhipster:$JHIPSTER_VERSION bash -c "./mvnw & yarn start --host 0.0.0.0" Thanks to https://www.thebasement.be/working-with-babel-7-and-webpack/ , https://babeljs.io/docs/en/usage and zloirock/core-js#514 (comment) for the hints! |
Better tip for jhipster/generator-jhipster#10184 issue describing full solution in order to use Babel to make IE11 correctly working with JHipster generated applications.
@anthony-o good job, but it don't work at prodcution mode, |
Thanks for sharing this! I can also confirm the solution works for other browsers like As @conquor pointed (thanks a lot!) changing all |
Overview of the issue
Our project is a generator project based on generator-jhipster.
Recently we updated our project core-js to 3.1.3. It can be run at Chrome, Edge.
But when we run it at IE 11. It will throw me some errors.
Motivation for or Use Case
Need to make our project compatible with IE 11.
Reproduce the error
1- Generate app.
2- Run app.
3- Use IE11 to open the address.
4- The screen will show
Related issues
Suggest a Fix
JHipster Version(s)
"ng-jhipster": "0.10.1",
"generator-jhipster": "6.1.2",
Browsers and Operating System
Windows 10 and Internet Explorer 11
The text was updated successfully, but these errors were encountered: