Skip to content

Errors during installation #3

@T-Mike

Description

@T-Mike

I have errors upon installation.
Tried both installing from marketplace and installing by git cloning, the same happens.
And also tried with directus 10.13.1 and directus 11.0.0.

ReferenceError: __filename is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/directus/extensions/.registry/7be6c346-03c8-4bf9-9faf-e44c03ebf862/package.json' contains \"type\": \"module\". 
To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

Removing "type": "module" in package.json does the trick.

Then I struggled to find the right place for the config file. I tried a lot of directories for this file, CosmiConfig does not seem to find anything anywhere. Then I tried a lot of combinations for EXTENSION_SEARCHSYNC_CONFIG_PATH... and... at some point I figured the path was relative to the inside of the directus container and used a shared folder (the one you put in the volume inside the docker-compose.yml).
Maybe would be useful to add more detail and/or an example in the README ?

And then another error:

WARN: Could not dynamically require "/directus/extensions/directus-extension-searchsync-2/.searchsyncrc.js".
Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.

My two cents it has something to do with "type": "module" removed but maybe you know how to resolve it?

For now, I ended up defining it directly in /src/config.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions