Skip to content
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

npm version doesn't work: "This is a abstract store for Notifications, it cannot be instantiated." #4163

Open
valpackett opened this issue May 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@valpackett
Copy link

Version (please indicate which version you are using):
17.2.5, tried some others as well

Platform (OS and Browser + version):
Linux, Firefox 125

Describe the bug

The code published on npm crashes in the following way upon instantiation:

Error: This is a abstract store for Notifications, it cannot be instantiated.
Did you forget to inject your store instance?

const stores = useStoreProvider();
stores.inject(MyMetaStore, storeInstance);
    MetaStore o-spreadsheet.esm.js:8084
    build o-spreadsheet.esm.js:8064
    instantiate o-spreadsheet.esm.js:8041
    get o-spreadsheet.esm.js:8036
    useStore o-spreadsheet.esm.js:8132
    setup o-spreadsheet.esm.js:56731
    ComponentNode owl.es.js:2354
    createComponent owl.es.js:5758
    template chunk-JBWWRFNB.js:23
    _render owl.es.js:1719
    render owl.es.js:1711
    initiateRender owl.es.js:2376
    mountComponent owl.es.js:2360
    mountNode owl.es.js:5688
    mount owl.es.js:5659
    <anonymous> index.html:269
    whenReady owl.es.js:306
    <anonymous> index.html:259

Spreadsheet.setup is defined like this in 17.2.5 npm release:

    setup() {
        const stores = useStoreProvider();
        stores.inject(ModelStore, this.model);
        this.notificationStore = useStore(NotificationStore);
        this.composerFocusStore = useStore(ComposerFocusStore);
        this.sidePanel = useStore(SidePanelStore);
        this.keyDownMapping = {
            "CTRL+H": () => this.sidePanel.toggle("FindAndReplace", {}),
            "CTRL+F": () => this.sidePanel.toggle("FindAndReplace", {}),
        };
        const fileStore = this.model.config.external.fileStore;

The 17.2.5 tag on GitHub, which actually refers to the 17.0.20 commit right now, does not contain any NotificationStore lines:

setup() {
this.sidePanel = useState({ isOpen: false, panelProps: {} });
this.composer = useState({
topBarFocus: "inactive",
gridFocusMode: "inactive",
});
this.keyDownMapping = {
"CTRL+H": () => this.toggleSidePanel("FindAndReplace", {}),
"CTRL+F": () => this.toggleSidePanel("FindAndReplace", {}),
};
const fileStore = this.model.config.external.fileStore;
useSubEnv({

and does work fine.

To Reproduce
Steps to reproduce the behavior:

  1. npm i --save @odoo/o-spreadsheet
  2. Try to build a basic example using the documentation
@valpackett valpackett added the bug Something isn't working label May 2, 2024
@rrahir
Copy link
Collaborator

rrahir commented May 6, 2024

Thanks for the report :) The release script seems to be at fault here, I will investigate it right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants