question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type Support with Webstorm / PhpStorm

See original GitHub issue

Environment

PhpStorm 2021.3


  • Operating System: Linux
  • Node Version: v16.11.1
  • Nuxt Version: 3.0.0-27313139.1c88580
  • Package Manager: yarn@1.22.15
  • Bundler: Vite
  • User Config: windicss, buildModules
  • Runtime Modules: -
  • Build Modules: nuxt-windicss@2.1.1

Reproduction

Follow steps here: https://v3.nuxtjs.org/getting-started/installation

Optionally to test this with a third-party module, do:

  1. yarn add nuxt-windicss
  2. Modify nuxt.config.ts
import { defineNuxtConfig } from 'nuxt3'

// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({

    windicss: {

    },

    buildModules: [
        'nuxt-windicss'
    ]

})

Describe the bug

When booting Nuxt v3 the .nuxt folder is correctly created, however, PhpStorm (and presumably WebStorm) determine the .nuxt folder to be a content root that should be excluded automatically. I’m not exactly sure what logic they’ve used to determine this, but possibly because it’s a dot folder.

image

<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
  <component name="NewModuleRootManager">
    <content url="file://$MODULE_DIR$">
      <excludeFolder url="file://$MODULE_DIR$/.nuxt" />
    </content>
    <content url="file://$MODULE_DIR$/.nuxt" />
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
  </component>
</module>

Due to this, when working on the project, the “magic imports” of the typescript definitions fail, leaving the user confused and with errors.

image

This is also an issue for third-party modules

image

This can be easily resolved by cancelling the exclusion (right-click -> Mark directory as -> Cancel Exclusion), for the onboarding of new users there should be either some documentation for this or a way to not have to do this at all.

image

Additional context

While I’m fairly sure this isn’t some special configuration or plugin in my PhpStorm/Webstorm creating this problem, it would be good to get confirmation from someone else who uses it.

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
danielroecommented, Jan 28, 2022
2reactions
ennioViscocommented, Sep 22, 2022

The thread can be closed: these issues will be fixed in next Webstorm EAP. See: https://youtrack.jetbrains.com/issue/WEB-56392/Nuxt-3-functions-exposed-in-importsdts-file-are-suggested-to-be-imported

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript | WebStorm Documentation - JetBrains
WebStorm verifies TypeScript code mainly based on the data from the TypeScript Language Service which also compiles TypeScript into JavaScript.
Read more >
Difference between WebStorm and PHPStorm - Stack Overflow
PhpStorm is designed to cover all needs of PHP developer including full JavaScript, CSS and HTML support. WebStorm is for hardcore JavaScript developers....
Read more >
PHPStorm vs WebStorm | Top 14 Differences and Comparisons
PHPStorm = PHP + WebStorm + DB/SQL; Robust Plugin Architecture; Includes front-end technologies; Supports frameworks such as Drupal, Yii, and WordPress.
Read more >
What Are the Differences Between PHPStorm and WebStorm?
WebStorm + Database support + WebStorm = PhpStorm ... in leveraging PHP while working on various types of web development projects.
Read more >
WebStorm Setup - Prettier
WebStorm comes with built-in support for Prettier. If you're using other JetBrains IDE like IntelliJ IDEA, PhpStorm, or PyCharm, make sure you have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found