Gitter got replaced by Slack. Please use following invite link https://slack.shopware.com to rejoin the awesome Shopware community! https://www.shopware.com/en/news/an-introduction-to-the-shopware-community-slack/
(SW6.2)
JS-Plugins of my themes only work in hot-reload-mode. If I do storefront:dev (or :build), I get error messages.
Chrome:
GET http://DOMAIN.TLD/theme/xxx/css/~scss/variables net::ERR_ABORTED 404 (Not Found)
all.js:8 Uncaught SyntaxError: Cannot use import statement outside a module
Firefox lists too a 404 for /variables and tells me also:
SyntaxError: import declarations may only appear at top level of a module
In this case my JS scripts won't run.
If I turn on hot-reload-mode (isHMRMode) and do a storefront:hot everything runs fine (and without error messages).
I don't understand those error messages and why it works in hot-reload-mode - but only in this mode.
I'm pretty sure I followed the how-to Shopware posted here: https://docs.shopware.com/en/shopware-platform-dev-en/theme-guide/javascript
My structure:
My /custom/plugins/THEMENAME/src/Resources/app/storefront/src/main.js looks like this:
import MyThemeFunctions from './my-theme-functions/my-theme-functions.plugin';
const PluginManager = window.PluginManager;
PluginManager.register('MyThemeFunctions', MyThemeFunctions);
And the following is my (shortened) /custom/plugins/THEMENAME/src/Resources/app/storefront/src/my-theme-functions/my-theme-functions.plugin.js:
import Plugin from 'src/plugin-system/plugin.class';
export default class MyThemeFunctions extends Plugin {
init.... etc..pp
}
this.TransactionService.getInvoiceDocument(salesChannelId, Order)
.then((response) => {
// do something????
})
entityService
name for a custom entity?
heya,
someone uses 6.2.0 production template with "bin/watch-administration.sh" and has the problem that one cannot login in administration with the proxy mode?
Seems like this is due to the usage of the cookiestorage instead of the localstorage now, and the context.api.url parameter seems everytime "localhost" where my domain is another due development, so that the authToken writes to localhost instead my domain..
Someone has the same problem or a solution for this?
Hey does anyone know? how to use theme inheritance. I was adding views in theme.json like so:
"views": [
"@Storefront",
"@Plugins",
"@Simple",
"@MyTheme"
],
But it does not change anything. All layouts are default from storefront. Removing all entries, has also no change in frontend.