You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import getPlaiceholder function inside src/index.ts and console.log it inside any of the hooks (as shown in the first image in Describe the Bug section).
Build extension with npm run build
Copy index.js from dist folder into Directus app at example-project/extensions/hooks/custom-hook/
npx directus start
Errors Shown
What version of Directus are you using?
9.4.3
What version of Node.js are you using?
v16.13.1
What database are you using?
Postgres 14.1
What browser are you using?
Chrome
What operating system are you using?
Windows 10
How are you deploying Directus?
running locally
The text was updated successfully, but these errors were encountered:
Preflight Checklist
Describe the Bug
I'm trying to use plaiceholder inside a custom hook but having problems.
The custom hook extension as the following index.ts file:
I build the extension, place it inside Directus app and run
npx directus start
. I get the following error:The same code works fine when executed in Next.js app getServerSideProps function.
As the error suggested, I tried configuring @rollup/plugin-commonjs by going by the instructions I found in the docs here https://docs.directus.io/extensions/creating-extensions/#configuring-the-cli :
With this config, the previous error is gone but I get a different one:
To Reproduce
npm init directus-extension
-> hook -> typescript -> name: custom-hooknpm init directus-project example-project
-> sqlite/postgrescd custom-hook
npm install plaiceholder
npm run build
Errors Shown
What version of Directus are you using?
9.4.3
What version of Node.js are you using?
v16.13.1
What database are you using?
Postgres 14.1
What browser are you using?
Chrome
What operating system are you using?
Windows 10
How are you deploying Directus?
running locally
The text was updated successfully, but these errors were encountered: