Skip to content

nuxt-directus: Permission error when trying to get collection fields on app init #51

@Akryum

Description

@Akryum

Discussed in #45

Originally posted by smkthat July 7, 2025
@rstore/nuxt-directus": "^0.6.17

Hello 👋
Can you help me understand what I'm doing wrong? This error occurs when rstore trying to getting fields in collections that are folders (knowledge and editor_nodes) in the data model interface. Is this a bug?

const fields = await directus.request(readFieldsByCollection(collection.collection)) as Array<DirectusField>

Screenshot 2025-07-07 at 23 44 03 Screenshot 2025-07-07 at 23 38 03 Screenshot 2025-07-07 at 23 40 47 Screenshot 2025-07-08 at 00 21 14

full log:

bun run dev
$ nuxt dev
Nuxt 3.17.6 with Nitro 2.11.13

  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

ℹ Using Tailwind CSS from ~/assets/css/tailwind.css
ℹ Using yup with vee-validate

 ERROR  Cannot start nuxt:  { errors:
   [ { message: "You don't have permission to access this.", extensions: [Object] } ],
  response:
   Response { status: 403,
     statusText: 'Forbidden',
     headers:
      Headers { 'content-security-policy':
         "script-src 'self' 'unsafe-eval' https://unpkg.com/[email protected]/;worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob: https://raw.githubusercontent.com https://avatars.githubusercontent.com;media-src 'self';connect-src 'self' https://* wss://*;frame-src http://localhost:3000 https://*.youtube.com https://*.vimeo.com;default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'",
        'x-powered-by': 'Directus',
        vary: 'Origin',
        'access-control-allow-credentials': 'true',
        'access-control-expose-headers': 'Content-Range',
        'content-type': 'application/json; charset=utf-8',
        'content-length': '102',
        etag: 'W/"66-OPr7zxcJy7+HqVGdrFe1XpeEIao"',
        date: 'Mon, 07 Jul 2025 13:13:39 GMT',
        connection: 'keep-alive',
        'keep-alive': 'timeout=5' },
     body: ReadableStream { locked: true, state: 'closed', supportsBYOB: true },
     bodyUsed: true,
     ok: false,
     redirected: false,
     type: 'basic',
     url: 'http://0.0.0.0:8055/fields/knowledge' } }
```</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions