-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
api platform no longer installs seamlessly with Symfony #58928
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
Comments
I am facing the same issue, my "resolution" was to remove a comment from the \vendor\api-platform\symfony\Bundle\Resources\public\graphiql\graphiql.min.js file. This line contains a code example with |
Yep, this code is commented out. // Asynchronous loading
/**
* Used in conjunction with the `m` component to reduce bundle size.
*
* `m` is a version of the `motion` component that only loads functionality
* critical for the initial render.
*
* `LazyMotion` can then be used to either synchronously or asynchronously
* load animation and gesture support.
*
* ```jsx
* // Synchronous loading
* import { LazyMotion, m, domAnimations } from "framer-motion"
*
* function App() {
* return (
* <LazyMotion features={domAnimations}>
* <m.div animate={{ scale: 2 }} />
* </LazyMotion>
* )
* }
*
* // Asynchronous loading
* import { LazyMotion, m } from "framer-motion"
*
* function App() {
* return (
* <LazyMotion features={() => import('./path/to/domAnimations')}>
* <m.div animate={{ scale: 2 }} />
* </LazyMotion>
* )
* }
* ```
*
* @public
*/ Since assetmapper is not a javascript parser, it gets the paths it needs to resolve with a regex. Perhaps this commit? Although that probably wasn't it because it just added unicode support. Until recently, this issue threw a warning in the javascript console, but now it won't even load. |
The regex grabs it, then I'll try to prepare a test maps some sort of fix. |
I added a test, and am now attempting to fix the isCommentedOut method. public static function provideCompileTests(): iterable
{
yield 'import_in_multiline_comment' => [
'input' => <<<EOF
// Asynchronous loading
/**
*
* function App() {
* return (
* <LazyMotion features={() => import('./path/to/domAnimations')}>
* <m.div animate={{ scale: 2 }} />
* </LazyMotion>
* )
* }
* ```
*
* @public
*/
EOF
,
'expectedJavaScriptImports' => [],
]; |
So it turned out to be a change in the asset-mapper recipe to make import strict in development. |
The recipe update was the issue for me as well. Configuring this back to |
As @adrianrudnik said, the problem is the asset mapper, I removed this line from composer.json And then I did run |
No, that's not the right solution, because the application may need asset-mapper. Instead, change # config/packages/asset_mapper.yaml
framework:
asset_mapper:
# The paths to make available to the asset mapper.
paths:
- assets/
missing_import_mode: warn The problem is that the original recipe had the missing_import_mode set to strict. |
Symfony version(s) affected
7.1
Description
API Platform version(s) affected: 4.0
A simple install with a Symfony webapp used to work but now throws an error.
How to reproduce
The files themselves, e.g.
https://127.0.0.1:8029/assets/bundles/apiplatform/swagger-ui/swagger-ui-standalone-preset-4fec96b52efef25338c0ee2a2c2619e4.js
I've reported this in api-platform as well: api-platform/api-platform#2801
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: