Comments (10)
Looks like it's related with the single runtime chunk functionality, disabling it solves the problem.
from sonataadminbundle.
I can confirm this bug. It seems to come from sonata/form-extensions >= 2.0
Starting with release 4.24.0, SonataAdmin allowed "sonata-project/form-extensions": "^1.15 || ^2.0".
Downgrading to "sonata-project/form-extensions": "^1.15"
removes the error.
I suppose this has something to do with switch to stimulus controllers and/or the switch to the new eonasdan/bootstrap-datetimepicker in sonata-project/form-extensions 2.0
from sonataadminbundle.
Maybe @jordisala1991 could help since he introduced stimulus...
but I would say it's hard without the related files...
(Is it because of .addEntry('main', './assets/admin/main.js')
?)
You could try to build less file, until it works to see which are the one with an issue. (Or at least having a smaller reproducer)
from sonataadminbundle.
@VincentLanglet I can also provide the contents of main.js or at least the main skeleton of the file (I'll append it to the ticket):
main.js
// css imports
import '../../public/bundles/mybundle/css/custom.css'; // just a plain css file, no sass/less or other transformers.
// javascript imports
import Masonry from 'masonry-layout';
window.onload = function() {
const container = document.querySelector('.masonry-grid');
if (container) {
new Masonry(container, {
itemSelector: '.grid-item',
columnWidth: '.grid-item'
});
}
}
// other irrelevant code
EDIT: also, to be 100% clear, the code builds fine, the error happens ONLY during runtime in the browser's console.
from sonataadminbundle.
Removing main.js does remove the presence of the second error.
If I remove fos_routing then both errors go away, but I'm also left without application javascript code 😅
This is looking more like a transpilation problem related to babel/webpack/foobar.
from sonataadminbundle.
Still looking for help here, I've tried the latest SonataAdminBundle minor version and played around with the settings in webpack config to no avail. I found similar error reports which seem to suggest that perhaps core-js and webpack/babel are interfering with each other.
Perhaps my package.json dependencies need to match the same ones as used in Sonata, so that they can be compatible?
I'll attach the contents of package.json
to the issue report, if that helps narrow this down.
Going back to SonataAdmin 4.23 always makes the issue go away.
from sonataadminbundle.
Looks like it's related with the single runtime chunk functionality, disabling it solves the problem.
Would it be worth opening an issue on webpack or webpack-encore side then ?
from sonataadminbundle.
Not sure if this can be labeled as an issue upstream or an issue with our particular setup to be honest.
I'm a bit out of my depth when it comes to webpack black magic.
I ended up having to update the admin webpack encore config to:
- .enableSingleRuntimeChunk()
+ .disableSingleRuntimeChunk()
and add an additional import for moment
using expose-loader
to have it available on the global scope for legacy code:
+import moment from 'expose-loader?exposes=moment!moment';
The symfony recommendation is to use single runtime chunk though, hence why we had this to begin with.
Why was it working before the introduction of stimulus and not after is beyond me.
from sonataadminbundle.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from sonataadminbundle.
ok then.
from sonataadminbundle.
Related Issues (20)
- Overriding createQuery doesn't seem to be a thing anymore HOT 2
- symfony 7 compatibility HOT 1
- Problem 1 - symfony/security-acl[v3.1.0, ..., v3.1.2] require symfony/security-core ^3.4|^4.4|^5.0 -> found symfony/security-core[v3.4.0, ..., v3.4.49, v4.4.0, ..., v4.4.48, v5.0.0, ..., v5.4.30] but it conflicts with your root composer.json require (7.0.*). HOT 2
- Customise error message for ModelManagerException HOT 1
- CSRF token error occurs on record creation after applying symfony/security-http security patch HOT 4
- List add item using inline form HOT 1
- The name "Doctrine\ODM\MongoDB\ArrayCollectionelements" contains illegal characters. HOT 2
- Input value "filters" contains a non-scalar value. HOT 3
- Incorrect Generic Typing for ModelManagerInterface HOT 1
- Batch actions `all_elements` on `SimplePager` HOT 1
- Incoherent batch behavior when performing batch all_elements and specifying id's at the same time HOT 2
- navbar_title missing for list view HOT 3
- status of runroom sortable behavior HOT 2
- Sonata causes some TWIG parent() calls to fail
- No entity manager defined for class HOT 6
- Please tag a release for latest commit in 3.x branch HOT 4
- canonicalize_locale_for_moment() returns null but my localization lang is set
- [admin 4.22.4] checkParentChildAssociation fails when parentAssociationMapping is null
- Model Type: New created entity does not get selected on sortable collections HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonataadminbundle.