# 预编译主题时出现未定义方法 \`resolve\_baked\_field\`

**URL:** <https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618>\
**Category:** Support\
**Created:** [2019年二月20日 06:20 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618 "2019-02-20T06:20:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)\
**Post date:** [2019年二月20日 06:20 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/1 "2019-02-20T06:20:38Z")

</div>

What would be a good method to diagnose

```plaintext
precompile target: desktop_theme 

rake aborted!

NoMethodError: undefined method `resolve_baked_field' for nil:NilClass

```

?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2019年二月20日 06:30 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/2 "2019-02-20T06:30:52Z")

</div>

Step 1️⃣ would be to be on latest, are you?

After that I would disable theme by theme to find which is the problem one.

---

<div class="post-metadata">

**Author:** ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)\
**Post date:** [2019年二月20日 06:40 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/3 "2019-02-20T06:40:21Z")

</div>

> [@sam](#):
>
> Step 1️⃣ would be to be on latest, are you?

Yes .. this was bulk standard

```plaintext
./launcher rebuild app

```

on a staging site which as I understand it gets the latest version.

---

<div class="post-metadata">

**Author:** ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)\
**Post date:** [2019年二月20日 06:41 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/4 "2019-02-20T06:41:47Z")

</div>

> [@sam](#):
>
> After that I would disable theme by theme to find which is the problem one

How do you disable themes on an instance that is not running?

---

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2019年二月20日 19:28 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/5 "2019-02-20T19:28:36Z")

</div>

> [@csmu](#):
>
> NoMethodError: undefined method `resolve\_baked\_field’ for nil:NilClass

Does it give you more than that? Typically, there’s a backtrace there.

---

<div class="post-metadata">

**Author:** ![csmu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/csmu/32/124581_2.png) [@csmu](https://meta.discourse.org/u/csmu)\
**Post date:** [2019年二月21日 08:39 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/6 "2019-02-21T08:39:11Z")

</div>

Based on the solution another post with a similar issue.

> [@Rebuild fails from theme error, site won't start](https://meta.discourse.org/t/rebuild-fails-from-theme-error-site-wont-start/108713/5):
>
> Ah, it’s possible that the old container was cleaned up when you ran `launcher cleanup` (since it wasn’t running).
> 
> Ok, can you try editing your `app.yml` file, and add this under the `env` section. Make sure the indentation is the same as all the other variables in that section.
> 
> ```plaintext
> DONT_PRECOMPILE_CSS: 1
> 
> ```
> 
> Then try rebuilding again.

I did the following

1. Added `DONT_PRECOMPILE_CSS: 1` to /var/discourse/containers/app.yml
2. `/var/discourse/launcher rebuild app` which worked
3. Selected a default theme in {{host}}/admin/customize/themes … no default theme was selected.
4. Commented out `DONT_PRECOMPILE_CSS: 1` in /var/discourse/containers/app.yml
5. `/var/discourse/launcher rebuild app` again, which worked.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2019年三月23日 08:39 UTC](https://meta.discourse.org/t/undefined-method-resolve-baked-field-when-precompiling-themes/109618/7 "2019-03-23T08:39:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
